Skip to content

Commit d2d514b

Browse files
authored
Merge pull request #192 from databyjp/bugfix/review-vectorizer-generative-configs
2 parents d077cd8 + 8efe3c8 commit d2d514b

File tree

5 files changed

+39
-15
lines changed

5 files changed

+39
-15
lines changed

src/Weaviate.Client/Configure/Vectorizer.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,14 @@ public static VectorConfigBuilder Text2VecMistral(
426426
}
427427
);
428428

429+
public static VectorConfigBuilder Text2VecModel2Vec(bool? vectorizeCollectionName = null) =>
430+
new(
431+
new Vectorizer.Text2VecModel2Vec
432+
{
433+
VectorizeCollectionName = vectorizeCollectionName,
434+
}
435+
);
436+
429437
public static VectorConfigBuilder Text2VecOllama(
430438
string? apiEndpoint = null,
431439
string? model = null,
@@ -516,12 +524,14 @@ public static VectorConfigBuilder Text2VecVoyageAI(
516524

517525
public static VectorConfigBuilder Text2VecJinaAI(
518526
string? model = null,
527+
int? dimensions = null,
519528
bool? vectorizeCollectionName = null
520529
) =>
521530
new(
522531
new Vectorizer.Text2VecJinaAI
523532
{
524533
Model = model,
534+
Dimensions = dimensions,
525535
VectorizeCollectionName = vectorizeCollectionName,
526536
}
527537
);

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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,18 @@ public Text2VecMistral()
285285
: base(IdentifierValue) { }
286286
}
287287

288+
/// <summary>
289+
/// The configuration for text vectorization using the Model2Vec module.
290+
/// See the documentation for detailed usage.
291+
/// </summary>
292+
public partial record Text2VecModel2Vec : VectorizerConfig
293+
{
294+
public const string IdentifierValue = "text2vec-model2vec";
295+
296+
public Text2VecModel2Vec()
297+
: base(IdentifierValue) { }
298+
}
299+
288300
/// <summary>
289301
/// The configuration for text vectorization using the Ollama module.
290302
/// See the documentation for detailed usage.

src/Weaviate.Client/Models/Vectorizer.cs

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

193-
public partial record Text2VecGPT4All
194-
{
195-
public bool? VectorizeCollectionName { get; set; } = null;
196-
}
197-
198193
public partial record Text2VecHuggingFace
199194
{
200195
public string? EndpointURL { get; set; } = null;
@@ -210,6 +205,7 @@ public partial record Text2VecHuggingFace
210205
public partial record Text2VecJinaAI
211206
{
212207
public string? Model { get; set; } = null;
208+
public int? Dimensions { get; set; } = null;
213209
public bool? VectorizeCollectionName { get; set; } = null;
214210
}
215211

@@ -241,6 +237,11 @@ public partial record Text2VecMistral
241237
public bool? VectorizeCollectionName { get; set; } = null;
242238
}
243239

240+
public partial record Text2VecModel2Vec
241+
{
242+
public bool? VectorizeCollectionName { get; set; } = null;
243+
}
244+
244245
public partial record Text2VecOllama
245246
{
246247
public string? ApiEndpoint { get; set; } = null;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ internal static class VectorizerConfigFactory
2727
{ Vectorizer.Text2VecJinaAI.IdentifierValue, typeof(Vectorizer.Text2VecJinaAI) },
2828
{ Vectorizer.Text2VecNvidia.IdentifierValue, typeof(Vectorizer.Text2VecNvidia) },
2929
{ Vectorizer.Text2VecMistral.IdentifierValue, typeof(Vectorizer.Text2VecMistral) },
30+
{ Vectorizer.Text2VecModel2Vec.IdentifierValue, typeof(Vectorizer.Text2VecModel2Vec) },
3031
{ Vectorizer.Text2VecOllama.IdentifierValue, typeof(Vectorizer.Text2VecOllama) },
3132
{ Vectorizer.Text2VecOpenAI.IdentifierValue, typeof(Vectorizer.Text2VecOpenAI) },
3233
{ Vectorizer.Text2VecGoogle.IdentifierValue, typeof(Vectorizer.Text2VecGoogle) },

0 commit comments

Comments
 (0)