From 7bdca925d269f2e21b9f3f2ea4d7cd15431c8c6f Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Wed, 26 Nov 2025 20:16:51 +0000 Subject: [PATCH 1/4] feat: Updates to vectorizer & generative module config options --- src/Weaviate.Client/Configure/Vectorizer.cs | 22 +++++++++++++++++ .../Models/GenerativeConfig.cs | 20 ++++++++-------- .../Models/Vectorizer.Declarations.cs | 24 +++++++++++++++++++ src/Weaviate.Client/Models/Vectorizer.cs | 10 ++++++-- .../Models/Vectorizers/Factory.cs | 2 ++ 5 files changed, 66 insertions(+), 12 deletions(-) diff --git a/src/Weaviate.Client/Configure/Vectorizer.cs b/src/Weaviate.Client/Configure/Vectorizer.cs index 1451bdf0..83f293df 100644 --- a/src/Weaviate.Client/Configure/Vectorizer.cs +++ b/src/Weaviate.Client/Configure/Vectorizer.cs @@ -356,6 +356,16 @@ public static VectorConfigBuilder Text2VecDatabricks( } ); + public static VectorConfigBuilder Text2VecGpt4All( + bool? vectorizeCollectionName = null + ) => + new( + new Vectorizer.Text2VecGpt4All + { + VectorizeCollectionName = vectorizeCollectionName, + } + ); + public static VectorConfigBuilder Text2VecHuggingFace( string? endpointURL = null, string? model = null, @@ -426,6 +436,16 @@ public static VectorConfigBuilder Text2VecMistral( } ); + public static VectorConfigBuilder Text2VecModel2Vec( + bool? vectorizeCollectionName = null + ) => + new( + new Vectorizer.Text2VecModel2Vec + { + VectorizeCollectionName = vectorizeCollectionName, + } + ); + public static VectorConfigBuilder Text2VecOllama( string? apiEndpoint = null, string? model = null, @@ -516,12 +536,14 @@ public static VectorConfigBuilder Text2VecVoyageAI( public static VectorConfigBuilder Text2VecJinaAI( string? model = null, + int? dimensions = null, bool? vectorizeCollectionName = null ) => new( new Vectorizer.Text2VecJinaAI { Model = model, + Dimensions = dimensions, VectorizeCollectionName = vectorizeCollectionName, } ); diff --git a/src/Weaviate.Client/Models/GenerativeConfig.cs b/src/Weaviate.Client/Models/GenerativeConfig.cs index 6bfca963..521f98ef 100644 --- a/src/Weaviate.Client/Models/GenerativeConfig.cs +++ b/src/Weaviate.Client/Models/GenerativeConfig.cs @@ -20,11 +20,11 @@ public record Custom : IGenerativeConfig public abstract record OpenAIBase : IGenerativeConfig { public string? BaseURL { get; set; } - public int? FrequencyPenaltyProperty { get; set; } - public int? MaxTokensProperty { get; set; } - public int? PresencePenaltyProperty { get; set; } - public double? TemperatureProperty { get; set; } - public double? TopPProperty { get; set; } + public int? FrequencyPenalty { get; set; } + public int? MaxTokens { get; set; } + public int? PresencePenalty { get; set; } + public double? Temperature { get; set; } + public double? TopP { get; set; } public abstract string Type { get; } } @@ -68,12 +68,12 @@ public record Cohere : IGenerativeConfig public const string TypeValue = "generative-cohere"; public string Type => TypeValue; - public int? KProperty { get; set; } + public int? K { get; set; } public string? Model { get; set; } - public int? MaxTokensProperty { get; set; } - public string? ReturnLikelihoodsProperty { get; set; } - public string[]? StopSequencesProperty { get; set; } - public double? TemperatureProperty { get; set; } + public int? MaxTokens { get; set; } + public string? ReturnLikelihoods { get; set; } + public string[]? StopSequences { get; set; } + public double? Temperature { get; set; } } public record Databricks : IGenerativeConfig diff --git a/src/Weaviate.Client/Models/Vectorizer.Declarations.cs b/src/Weaviate.Client/Models/Vectorizer.Declarations.cs index bcdbab6f..f8ed77fa 100644 --- a/src/Weaviate.Client/Models/Vectorizer.Declarations.cs +++ b/src/Weaviate.Client/Models/Vectorizer.Declarations.cs @@ -221,6 +221,18 @@ public Text2VecDatabricks() : base(IdentifierValue) { } } + /// + /// The configuration for text vectorization using the GPT4All module. + /// See the documentation for detailed usage. + /// + public partial record Text2VecGpt4All : VectorizerConfig + { + public const string IdentifierValue = "text2vec-gpt4all"; + + public Text2VecGpt4All() + : base(IdentifierValue) { } + } + /// /// The configuration for text vectorization using the HuggingFace module. /// See the documentation for detailed usage. @@ -285,6 +297,18 @@ public Text2VecMistral() : base(IdentifierValue) { } } + /// + /// The configuration for text vectorization using the Model2Vec module. + /// See the documentation for detailed usage. + /// + public partial record Text2VecModel2Vec : VectorizerConfig + { + public const string IdentifierValue = "text2vec-model2vec"; + + public Text2VecModel2Vec() + : base(IdentifierValue) { } + } + /// /// The configuration for text vectorization using the Ollama module. /// See the documentation for detailed usage. diff --git a/src/Weaviate.Client/Models/Vectorizer.cs b/src/Weaviate.Client/Models/Vectorizer.cs index 442e8c80..0a6bc83b 100644 --- a/src/Weaviate.Client/Models/Vectorizer.cs +++ b/src/Weaviate.Client/Models/Vectorizer.cs @@ -190,7 +190,7 @@ public partial record Text2VecDatabricks public bool? VectorizeCollectionName { get; set; } = null; } - public partial record Text2VecGPT4All + public partial record Text2VecGpt4All { public bool? VectorizeCollectionName { get; set; } = null; } @@ -210,6 +210,7 @@ public partial record Text2VecHuggingFace public partial record Text2VecJinaAI { public string? Model { get; set; } = null; + public int? Dimensions { get; set; } = null; public bool? VectorizeCollectionName { get; set; } = null; } @@ -237,7 +238,12 @@ public partial record Multi2VecNvidia public partial record Text2VecMistral { public string? BaseURL { get; set; } = null; - public string? Model { get; set; } = null; + public string? Model { get; set; } = null; + public bool? VectorizeCollectionName { get; set; } = null; + } + + public partial record Text2VecModel2Vec + { public bool? VectorizeCollectionName { get; set; } = null; } diff --git a/src/Weaviate.Client/Models/Vectorizers/Factory.cs b/src/Weaviate.Client/Models/Vectorizers/Factory.cs index 68ab8659..256c95ac 100644 --- a/src/Weaviate.Client/Models/Vectorizers/Factory.cs +++ b/src/Weaviate.Client/Models/Vectorizers/Factory.cs @@ -23,10 +23,12 @@ internal static class VectorizerConfigFactory { Vectorizer.Text2VecAzureOpenAI.IdentifierValue, typeof(Vectorizer.Text2VecAzureOpenAI) }, { Vectorizer.Text2VecCohere.IdentifierValue, typeof(Vectorizer.Text2VecCohere) }, { Vectorizer.Text2VecDatabricks.IdentifierValue, typeof(Vectorizer.Text2VecDatabricks) }, + { Vectorizer.Text2VecGpt4All.IdentifierValue, typeof(Vectorizer.Text2VecGpt4All) }, { Vectorizer.Text2VecHuggingFace.IdentifierValue, typeof(Vectorizer.Text2VecHuggingFace) }, { Vectorizer.Text2VecJinaAI.IdentifierValue, typeof(Vectorizer.Text2VecJinaAI) }, { Vectorizer.Text2VecNvidia.IdentifierValue, typeof(Vectorizer.Text2VecNvidia) }, { Vectorizer.Text2VecMistral.IdentifierValue, typeof(Vectorizer.Text2VecMistral) }, + { Vectorizer.Text2VecModel2Vec.IdentifierValue, typeof(Vectorizer.Text2VecModel2Vec) }, { Vectorizer.Text2VecOllama.IdentifierValue, typeof(Vectorizer.Text2VecOllama) }, { Vectorizer.Text2VecOpenAI.IdentifierValue, typeof(Vectorizer.Text2VecOpenAI) }, { Vectorizer.Text2VecGoogle.IdentifierValue, typeof(Vectorizer.Text2VecGoogle) }, From 15336bd0c51ce05ababe7a6522657416b7c2aada Mon Sep 17 00:00:00 2001 From: Michelangelo Partipilo Date: Fri, 28 Nov 2025 13:30:48 +0100 Subject: [PATCH 2/4] fix formatting --- src/Weaviate.Client/Configure/Vectorizer.cs | 21 +++++++------------ .../Models/Vectorizer.Declarations.cs | 4 ++-- src/Weaviate.Client/Models/Vectorizer.cs | 4 ++-- .../Models/Vectorizers/Factory.cs | 2 +- 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/Weaviate.Client/Configure/Vectorizer.cs b/src/Weaviate.Client/Configure/Vectorizer.cs index 83f293df..9e226315 100644 --- a/src/Weaviate.Client/Configure/Vectorizer.cs +++ b/src/Weaviate.Client/Configure/Vectorizer.cs @@ -356,16 +356,11 @@ public static VectorConfigBuilder Text2VecDatabricks( } ); - public static VectorConfigBuilder Text2VecGpt4All( - bool? vectorizeCollectionName = null - ) => + public static VectorConfigBuilder Text2VecGpt4All(bool? vectorizeCollectionName = null) => new( - new Vectorizer.Text2VecGpt4All - { - VectorizeCollectionName = vectorizeCollectionName, - } - ); - + new Vectorizer.Text2VecGpt4All { VectorizeCollectionName = vectorizeCollectionName } + ); + public static VectorConfigBuilder Text2VecHuggingFace( string? endpointURL = null, string? model = null, @@ -436,16 +431,14 @@ public static VectorConfigBuilder Text2VecMistral( } ); - public static VectorConfigBuilder Text2VecModel2Vec( - bool? vectorizeCollectionName = null - ) => + public static VectorConfigBuilder Text2VecModel2Vec(bool? vectorizeCollectionName = null) => new( new Vectorizer.Text2VecModel2Vec { VectorizeCollectionName = vectorizeCollectionName, } - ); - + ); + public static VectorConfigBuilder Text2VecOllama( string? apiEndpoint = null, string? model = null, diff --git a/src/Weaviate.Client/Models/Vectorizer.Declarations.cs b/src/Weaviate.Client/Models/Vectorizer.Declarations.cs index f8ed77fa..c3acd257 100644 --- a/src/Weaviate.Client/Models/Vectorizer.Declarations.cs +++ b/src/Weaviate.Client/Models/Vectorizer.Declarations.cs @@ -231,8 +231,8 @@ public partial record Text2VecGpt4All : VectorizerConfig public Text2VecGpt4All() : base(IdentifierValue) { } - } - + } + /// /// The configuration for text vectorization using the HuggingFace module. /// See the documentation for detailed usage. diff --git a/src/Weaviate.Client/Models/Vectorizer.cs b/src/Weaviate.Client/Models/Vectorizer.cs index 0a6bc83b..6fa9c791 100644 --- a/src/Weaviate.Client/Models/Vectorizer.cs +++ b/src/Weaviate.Client/Models/Vectorizer.cs @@ -238,10 +238,10 @@ public partial record Multi2VecNvidia public partial record Text2VecMistral { public string? BaseURL { get; set; } = null; - public string? Model { get; set; } = null; + public string? Model { get; set; } = null; public bool? VectorizeCollectionName { get; set; } = null; } - + public partial record Text2VecModel2Vec { public bool? VectorizeCollectionName { get; set; } = null; diff --git a/src/Weaviate.Client/Models/Vectorizers/Factory.cs b/src/Weaviate.Client/Models/Vectorizers/Factory.cs index 256c95ac..2a909698 100644 --- a/src/Weaviate.Client/Models/Vectorizers/Factory.cs +++ b/src/Weaviate.Client/Models/Vectorizers/Factory.cs @@ -23,7 +23,7 @@ internal static class VectorizerConfigFactory { Vectorizer.Text2VecAzureOpenAI.IdentifierValue, typeof(Vectorizer.Text2VecAzureOpenAI) }, { Vectorizer.Text2VecCohere.IdentifierValue, typeof(Vectorizer.Text2VecCohere) }, { Vectorizer.Text2VecDatabricks.IdentifierValue, typeof(Vectorizer.Text2VecDatabricks) }, - { Vectorizer.Text2VecGpt4All.IdentifierValue, typeof(Vectorizer.Text2VecGpt4All) }, + { Vectorizer.Text2VecGpt4All.IdentifierValue, typeof(Vectorizer.Text2VecGpt4All) }, { Vectorizer.Text2VecHuggingFace.IdentifierValue, typeof(Vectorizer.Text2VecHuggingFace) }, { Vectorizer.Text2VecJinaAI.IdentifierValue, typeof(Vectorizer.Text2VecJinaAI) }, { Vectorizer.Text2VecNvidia.IdentifierValue, typeof(Vectorizer.Text2VecNvidia) }, From d7c83465eb4d2f051531e5165765aafae99fcea2 Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Tue, 2 Dec 2025 08:39:52 +0000 Subject: [PATCH 3/4] Remove gpt4all --- src/Weaviate.Client/Models/Vectorizers/Factory.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Weaviate.Client/Models/Vectorizers/Factory.cs b/src/Weaviate.Client/Models/Vectorizers/Factory.cs index 2a909698..d0d31c8f 100644 --- a/src/Weaviate.Client/Models/Vectorizers/Factory.cs +++ b/src/Weaviate.Client/Models/Vectorizers/Factory.cs @@ -23,7 +23,6 @@ internal static class VectorizerConfigFactory { Vectorizer.Text2VecAzureOpenAI.IdentifierValue, typeof(Vectorizer.Text2VecAzureOpenAI) }, { Vectorizer.Text2VecCohere.IdentifierValue, typeof(Vectorizer.Text2VecCohere) }, { Vectorizer.Text2VecDatabricks.IdentifierValue, typeof(Vectorizer.Text2VecDatabricks) }, - { Vectorizer.Text2VecGpt4All.IdentifierValue, typeof(Vectorizer.Text2VecGpt4All) }, { Vectorizer.Text2VecHuggingFace.IdentifierValue, typeof(Vectorizer.Text2VecHuggingFace) }, { Vectorizer.Text2VecJinaAI.IdentifierValue, typeof(Vectorizer.Text2VecJinaAI) }, { Vectorizer.Text2VecNvidia.IdentifierValue, typeof(Vectorizer.Text2VecNvidia) }, From 8efe3c89fcb03e8aaddc0ca478855f498cb4074d Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Tue, 2 Dec 2025 08:41:28 +0000 Subject: [PATCH 4/4] refactor: remove Text2VecGpt4All configuration and related methods --- src/Weaviate.Client/Configure/Vectorizer.cs | 5 ----- .../Models/Vectorizer.Declarations.cs | 12 ------------ src/Weaviate.Client/Models/Vectorizer.cs | 5 ----- 3 files changed, 22 deletions(-) diff --git a/src/Weaviate.Client/Configure/Vectorizer.cs b/src/Weaviate.Client/Configure/Vectorizer.cs index 9e226315..65425867 100644 --- a/src/Weaviate.Client/Configure/Vectorizer.cs +++ b/src/Weaviate.Client/Configure/Vectorizer.cs @@ -356,11 +356,6 @@ public static VectorConfigBuilder Text2VecDatabricks( } ); - public static VectorConfigBuilder Text2VecGpt4All(bool? vectorizeCollectionName = null) => - new( - new Vectorizer.Text2VecGpt4All { VectorizeCollectionName = vectorizeCollectionName } - ); - public static VectorConfigBuilder Text2VecHuggingFace( string? endpointURL = null, string? model = null, diff --git a/src/Weaviate.Client/Models/Vectorizer.Declarations.cs b/src/Weaviate.Client/Models/Vectorizer.Declarations.cs index c3acd257..d4d3bfc9 100644 --- a/src/Weaviate.Client/Models/Vectorizer.Declarations.cs +++ b/src/Weaviate.Client/Models/Vectorizer.Declarations.cs @@ -221,18 +221,6 @@ public Text2VecDatabricks() : base(IdentifierValue) { } } - /// - /// The configuration for text vectorization using the GPT4All module. - /// See the documentation for detailed usage. - /// - public partial record Text2VecGpt4All : VectorizerConfig - { - public const string IdentifierValue = "text2vec-gpt4all"; - - public Text2VecGpt4All() - : base(IdentifierValue) { } - } - /// /// The configuration for text vectorization using the HuggingFace module. /// See the documentation for detailed usage. diff --git a/src/Weaviate.Client/Models/Vectorizer.cs b/src/Weaviate.Client/Models/Vectorizer.cs index 6fa9c791..985ee107 100644 --- a/src/Weaviate.Client/Models/Vectorizer.cs +++ b/src/Weaviate.Client/Models/Vectorizer.cs @@ -190,11 +190,6 @@ public partial record Text2VecDatabricks public bool? VectorizeCollectionName { get; set; } = null; } - public partial record Text2VecGpt4All - { - public bool? VectorizeCollectionName { get; set; } = null; - } - public partial record Text2VecHuggingFace { public string? EndpointURL { get; set; } = null;