Skip to content

Commit 7bdca92

Browse files
committed
feat: Updates to vectorizer & generative module config options
1 parent 210c0fe commit 7bdca92

File tree

5 files changed

+66
-12
lines changed

5 files changed

+66
-12
lines changed

src/Weaviate.Client/Configure/Vectorizer.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,16 @@ public static VectorConfigBuilder Text2VecDatabricks(
356356
}
357357
);
358358

359+
public static VectorConfigBuilder Text2VecGpt4All(
360+
bool? vectorizeCollectionName = null
361+
) =>
362+
new(
363+
new Vectorizer.Text2VecGpt4All
364+
{
365+
VectorizeCollectionName = vectorizeCollectionName,
366+
}
367+
);
368+
359369
public static VectorConfigBuilder Text2VecHuggingFace(
360370
string? endpointURL = null,
361371
string? model = null,
@@ -426,6 +436,16 @@ public static VectorConfigBuilder Text2VecMistral(
426436
}
427437
);
428438

439+
public static VectorConfigBuilder Text2VecModel2Vec(
440+
bool? vectorizeCollectionName = null
441+
) =>
442+
new(
443+
new Vectorizer.Text2VecModel2Vec
444+
{
445+
VectorizeCollectionName = vectorizeCollectionName,
446+
}
447+
);
448+
429449
public static VectorConfigBuilder Text2VecOllama(
430450
string? apiEndpoint = null,
431451
string? model = null,
@@ -516,12 +536,14 @@ public static VectorConfigBuilder Text2VecVoyageAI(
516536

517537
public static VectorConfigBuilder Text2VecJinaAI(
518538
string? model = null,
539+
int? dimensions = null,
519540
bool? vectorizeCollectionName = null
520541
) =>
521542
new(
522543
new Vectorizer.Text2VecJinaAI
523544
{
524545
Model = model,
546+
Dimensions = dimensions,
525547
VectorizeCollectionName = vectorizeCollectionName,
526548
}
527549
);

src/Weaviate.Client/Models/GenerativeConfig.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public record Custom : IGenerativeConfig
2020
public abstract record OpenAIBase : IGenerativeConfig
2121
{
2222
public string? BaseURL { get; set; }
23-
public int? FrequencyPenaltyProperty { get; set; }
24-
public int? MaxTokensProperty { get; set; }
25-
public int? PresencePenaltyProperty { get; set; }
26-
public double? TemperatureProperty { get; set; }
27-
public double? TopPProperty { get; set; }
23+
public int? FrequencyPenalty { get; set; }
24+
public int? MaxTokens { get; set; }
25+
public int? PresencePenalty { get; set; }
26+
public double? Temperature { get; set; }
27+
public double? TopP { get; set; }
2828
public abstract string Type { get; }
2929
}
3030

@@ -68,12 +68,12 @@ public record Cohere : IGenerativeConfig
6868
public const string TypeValue = "generative-cohere";
6969
public string Type => TypeValue;
7070

71-
public int? KProperty { get; set; }
71+
public int? K { get; set; }
7272
public string? Model { get; set; }
73-
public int? MaxTokensProperty { get; set; }
74-
public string? ReturnLikelihoodsProperty { get; set; }
75-
public string[]? StopSequencesProperty { get; set; }
76-
public double? TemperatureProperty { get; set; }
73+
public int? MaxTokens { get; set; }
74+
public string? ReturnLikelihoods { get; set; }
75+
public string[]? StopSequences { get; set; }
76+
public double? Temperature { get; set; }
7777
}
7878

7979
public record Databricks : IGenerativeConfig

src/Weaviate.Client/Models/Vectorizer.Declarations.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,18 @@ public Text2VecDatabricks()
221221
: base(IdentifierValue) { }
222222
}
223223

224+
/// <summary>
225+
/// The configuration for text vectorization using the GPT4All module.
226+
/// See the documentation for detailed usage.
227+
/// </summary>
228+
public partial record Text2VecGpt4All : VectorizerConfig
229+
{
230+
public const string IdentifierValue = "text2vec-gpt4all";
231+
232+
public Text2VecGpt4All()
233+
: base(IdentifierValue) { }
234+
}
235+
224236
/// <summary>
225237
/// The configuration for text vectorization using the HuggingFace module.
226238
/// See the documentation for detailed usage.
@@ -285,6 +297,18 @@ public Text2VecMistral()
285297
: base(IdentifierValue) { }
286298
}
287299

300+
/// <summary>
301+
/// The configuration for text vectorization using the Model2Vec module.
302+
/// See the documentation for detailed usage.
303+
/// </summary>
304+
public partial record Text2VecModel2Vec : VectorizerConfig
305+
{
306+
public const string IdentifierValue = "text2vec-model2vec";
307+
308+
public Text2VecModel2Vec()
309+
: base(IdentifierValue) { }
310+
}
311+
288312
/// <summary>
289313
/// The configuration for text vectorization using the Ollama module.
290314
/// See the documentation for detailed usage.

src/Weaviate.Client/Models/Vectorizer.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public partial record Text2VecDatabricks
190190
public bool? VectorizeCollectionName { get; set; } = null;
191191
}
192192

193-
public partial record Text2VecGPT4All
193+
public partial record Text2VecGpt4All
194194
{
195195
public bool? VectorizeCollectionName { get; set; } = null;
196196
}
@@ -210,6 +210,7 @@ public partial record Text2VecHuggingFace
210210
public partial record Text2VecJinaAI
211211
{
212212
public string? Model { get; set; } = null;
213+
public int? Dimensions { get; set; } = null;
213214
public bool? VectorizeCollectionName { get; set; } = null;
214215
}
215216

@@ -237,7 +238,12 @@ public partial record Multi2VecNvidia
237238
public partial record Text2VecMistral
238239
{
239240
public string? BaseURL { get; set; } = null;
240-
public string? Model { get; set; } = null;
241+
public string? Model { get; set; } = null;
242+
public bool? VectorizeCollectionName { get; set; } = null;
243+
}
244+
245+
public partial record Text2VecModel2Vec
246+
{
241247
public bool? VectorizeCollectionName { get; set; } = null;
242248
}
243249

src/Weaviate.Client/Models/Vectorizers/Factory.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ internal static class VectorizerConfigFactory
2323
{ Vectorizer.Text2VecAzureOpenAI.IdentifierValue, typeof(Vectorizer.Text2VecAzureOpenAI) },
2424
{ Vectorizer.Text2VecCohere.IdentifierValue, typeof(Vectorizer.Text2VecCohere) },
2525
{ Vectorizer.Text2VecDatabricks.IdentifierValue, typeof(Vectorizer.Text2VecDatabricks) },
26+
{ Vectorizer.Text2VecGpt4All.IdentifierValue, typeof(Vectorizer.Text2VecGpt4All) },
2627
{ Vectorizer.Text2VecHuggingFace.IdentifierValue, typeof(Vectorizer.Text2VecHuggingFace) },
2728
{ Vectorizer.Text2VecJinaAI.IdentifierValue, typeof(Vectorizer.Text2VecJinaAI) },
2829
{ Vectorizer.Text2VecNvidia.IdentifierValue, typeof(Vectorizer.Text2VecNvidia) },
2930
{ Vectorizer.Text2VecMistral.IdentifierValue, typeof(Vectorizer.Text2VecMistral) },
31+
{ Vectorizer.Text2VecModel2Vec.IdentifierValue, typeof(Vectorizer.Text2VecModel2Vec) },
3032
{ Vectorizer.Text2VecOllama.IdentifierValue, typeof(Vectorizer.Text2VecOllama) },
3133
{ Vectorizer.Text2VecOpenAI.IdentifierValue, typeof(Vectorizer.Text2VecOpenAI) },
3234
{ Vectorizer.Text2VecGoogle.IdentifierValue, typeof(Vectorizer.Text2VecGoogle) },

0 commit comments

Comments
 (0)