From a615aa282b3d4220466b3cd6f0e529ed2bcd0f8b Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Wed, 26 Nov 2025 22:00:22 +0000 Subject: [PATCH 01/17] model-provider-updates --- .../generative/AnthropicGenerative.java | 1 + .../collections/generative/AwsGenerative.java | 81 ++++++++++++++++++- .../generative/AzureOpenAiGenerative.java | 10 +-- .../generative/CohereGenerative.java | 10 +-- .../generative/OpenAiGenerative.java | 10 +-- 5 files changed, 95 insertions(+), 17 deletions(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java index 91ac0f68b..b37559cae 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java @@ -14,6 +14,7 @@ import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative; public record AnthropicGenerative( + @SerializedName("baseURL") String baseUrl, @SerializedName("model") String model, @SerializedName("maxTokens") Integer maxTokens, @SerializedName("temperature") Float temperature, diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AwsGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AwsGenerative.java index a5593bf26..0e3dd747f 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AwsGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AwsGenerative.java @@ -18,7 +18,15 @@ public record AwsGenerative( @SerializedName("region") String region, @SerializedName("service") Service service, @SerializedName("endpoint") String endpoint, - @SerializedName("model") String model) implements Generative { + @SerializedName("model") String model, + @SerializedName("targetModel") String targetModel, + @SerializedName("targetVariant") String targetVariant, + @SerializedName("temperature") Float temperature, + @SerializedName("maxTokenCount") Integer maxTokenCount, + @SerializedName("maxTokensToSample") Integer maxTokensToSample, + @SerializedName("topP") Float topP, + @SerializedName("topK") Integer topK, + @SerializedName("stopSequences") List stopSequences) implements Generative { @Override public Generative.Kind _kind() { @@ -53,7 +61,15 @@ public AwsGenerative(Builder builder) { builder.region, builder.service, builder.endpoint, - builder.model); + builder.model, + builder.targetModel, + builder.targetVariant, + builder.temperature, + builder.maxTokenCount, + builder.maxTokensToSample, + builder.topP, + builder.topK, + builder.stopSequences); } public static class Builder implements ObjectBuilder { @@ -67,6 +83,14 @@ public Builder(Service service, String region) { private String endpoint; private String model; + private String targetModel; + private String targetVariant; + private Float temperature; + private Integer maxTokenCount; + private Integer maxTokensToSample; + private Float topP; + private Integer topK; + private final List stopSequences = new ArrayList<>(); /** Base URL of the generative provider. */ protected Builder endpoint(String endpoint) { @@ -80,6 +104,59 @@ protected Builder model(String model) { return this; } + /** Target model for Sagemaker. */ + public Builder targetModel(String targetModel) { + this.targetModel = targetModel; + return this; + } + + /** Target variant for Sagemaker. */ + public Builder targetVariant(String targetVariant) { + this.targetVariant = targetVariant; + return this; + } + + /** Control the randomness of the model's output. */ + public Builder temperature(Float temperature) { + this.temperature = temperature; + return this; + } + + /** Maximum number of tokens to generate. */ + public Builder maxTokenCount(Integer maxTokenCount) { + this.maxTokenCount = maxTokenCount; + return this; + } + + /** Maximum number of tokens to sample (for Anthropic models). */ + public Builder maxTokensToSample(Integer maxTokensToSample) { + this.maxTokensToSample = maxTokensToSample; + return this; + } + + /** Top-p sampling parameter. */ + public Builder topP(Float topP) { + this.topP = topP; + return this; + } + + /** Top-k sampling parameter. */ + public Builder topK(Integer topK) { + this.topK = topK; + return this; + } + + /** Stop sequences for the model. */ + public Builder stopSequences(String... stopSequences) { + return stopSequences(Arrays.asList(stopSequences)); + } + + /** Stop sequences for the model. */ + public Builder stopSequences(List stopSequences) { + this.stopSequences.addAll(stopSequences); + return this; + } + @Override public AwsGenerative build() { return new AwsGenerative(this); diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AzureOpenAiGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AzureOpenAiGenerative.java index 78c47c75f..651a54d9b 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AzureOpenAiGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AzureOpenAiGenerative.java @@ -15,11 +15,11 @@ public record AzureOpenAiGenerative( @SerializedName("baseURL") String baseUrl, - @SerializedName("frequencyPenaltyProperty") Float frequencyPenalty, - @SerializedName("presencePenaltyProperty") Float presencePenalty, - @SerializedName("maxTokensProperty") Integer maxTokens, - @SerializedName("temperatureProperty") Float temperature, - @SerializedName("topPProperty") Float topP, + @SerializedName("frequencyPenalty") Float frequencyPenalty, + @SerializedName("presencePenalty") Float presencePenalty, + @SerializedName("maxTokens") Integer maxTokens, + @SerializedName("temperature") Float temperature, + @SerializedName("topP") Float topP, @SerializedName("resourceName") String resourceName, @SerializedName("deploymentId") String deploymentId) implements Generative { diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/CohereGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/CohereGenerative.java index cc803b20f..d1605df8d 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/CohereGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/CohereGenerative.java @@ -15,12 +15,12 @@ public record CohereGenerative( @SerializedName("baseURL") String baseUrl, - @SerializedName("kProperty") Integer topK, + @SerializedName("k") Integer topK, @SerializedName("model") String model, - @SerializedName("maxTokensProperty") Integer maxTokens, - @SerializedName("temperatureProperty") Float temperature, - @SerializedName("returnLikelihoodsProperty") String returnLikelihoodsProperty, - @SerializedName("stopSequencesProperty") List stopSequences) implements Generative { + @SerializedName("maxTokens") Integer maxTokens, + @SerializedName("temperature") Float temperature, + @SerializedName("returnLikelihoods") String returnLikelihoodsProperty, + @SerializedName("stopSequences") List stopSequences) implements Generative { @Override public Kind _kind() { diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/OpenAiGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/OpenAiGenerative.java index 5e8c40db8..324c8cedc 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/OpenAiGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/OpenAiGenerative.java @@ -15,11 +15,11 @@ public record OpenAiGenerative( @SerializedName("baseURL") String baseUrl, - @SerializedName("frequencyPenaltyProperty") Float frequencyPenalty, - @SerializedName("presencePenaltyProperty") Float presencePenalty, - @SerializedName("maxTokensProperty") Integer maxTokens, - @SerializedName("temperatureProperty") Float temperature, - @SerializedName("topPProperty") Float topP, + @SerializedName("frequencyPenalty") Float frequencyPenalty, + @SerializedName("presencePenalty") Float presencePenalty, + @SerializedName("maxTokens") Integer maxTokens, + @SerializedName("temperature") Float temperature, + @SerializedName("topP") Float topP, @SerializedName("model") String model) implements Generative { From 7ab8160a004a6cec948e68d65fd0ea346dcd756f Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Wed, 26 Nov 2025 22:41:58 +0000 Subject: [PATCH 02/17] feat: add missing fields to GoogleGenerative, NvidiaGenerative and XaiGenerative --- .../generative/GoogleGenerative.java | 27 +++++++++++++++++++ .../generative/NvidiaGenerative.java | 13 +++++++-- .../collections/generative/XaiGenerative.java | 12 +++++++-- 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/GoogleGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/GoogleGenerative.java index f41d359bd..8a34921d3 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/GoogleGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/GoogleGenerative.java @@ -18,6 +18,9 @@ public record GoogleGenerative( @SerializedName("apiEndpoint") String apiEndpoint, @SerializedName("modelId") String modelId, @SerializedName("projectId") String projectId, + @SerializedName("endpointId") String endpointId, + @SerializedName("region") String region, + @SerializedName("model") String model, @SerializedName("maxOutputTokens") Integer maxTokens, @SerializedName("topK") Integer topK, @SerializedName("topP") Float topP, @@ -54,6 +57,9 @@ public GoogleGenerative(Builder builder) { builder.apiEndpoint, builder.modelId, builder.projectId, + builder.endpointId, + builder.region, + builder.model, builder.maxTokens, builder.topK, builder.topP, @@ -65,6 +71,9 @@ public abstract static class Builder implements ObjectBuilder private final String projectId; private String modelId; + private String endpointId; + private String region; + private String model; private Integer maxTokens; private Integer topK; private Float topP; @@ -87,6 +96,24 @@ public Builder modelId(String modelId) { return this; } + /** Endpoint ID for Vertex AI. */ + public Builder endpointId(String endpointId) { + this.endpointId = endpointId; + return this; + } + + /** Google region. */ + public Builder region(String region) { + this.region = region; + return this; + } + + /** Generative model. */ + public Builder model(String model) { + this.model = model; + return this; + } + /** Limit the number of tokens to generate in the response. */ public Builder maxTokens(int maxTokens) { this.maxTokens = maxTokens; diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/NvidiaGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/NvidiaGenerative.java index 81f414641..9ce8ea0e7 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/NvidiaGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/NvidiaGenerative.java @@ -13,7 +13,8 @@ public record NvidiaGenerative( @SerializedName("baseURL") String baseUrl, @SerializedName("model") String model, @SerializedName("maxTokens") Integer maxTokens, - @SerializedName("temperature") Float temperature) implements Generative { + @SerializedName("temperature") Float temperature + @SerializedName("topP") Float topP) implements Generative { @Override public Kind _kind() { @@ -38,7 +39,8 @@ public NvidiaGenerative(Builder builder) { builder.baseUrl, builder.model, builder.maxTokens, - builder.temperature); + builder.temperature, + builder.topP); } public static class Builder implements ObjectBuilder { @@ -46,6 +48,7 @@ public static class Builder implements ObjectBuilder { private String model; private Integer maxTokens; private Float temperature; + private Float topP; /** Base URL of the generative provider. */ public Builder baseUrl(String baseUrl) { @@ -74,6 +77,12 @@ public Builder temperature(float temperature) { return this; } + /** Top P value for sampling. */ + public Builder topP(float topP) { + this.topP = topP; + return this; + } + @Override public NvidiaGenerative build() { return new NvidiaGenerative(this); diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/XaiGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/XaiGenerative.java index 687d82dbc..981feafac 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/XaiGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/XaiGenerative.java @@ -17,7 +17,8 @@ public record XaiGenerative( @SerializedName("baseURL") String baseUrl, @SerializedName("model") String model, @SerializedName("maxTokens") Integer maxTokens, - @SerializedName("temperature") Float temperature) implements Generative { + @SerializedName("temperature") Float temperature, + @SerializedName("topP") Float topP) implements Generative { @Override public Kind _kind() { @@ -42,7 +43,8 @@ public XaiGenerative(Builder builder) { builder.baseUrl, builder.model, builder.maxTokens, - builder.temperature); + builder.temperature, + builder.topP); } public static class Builder implements ObjectBuilder { @@ -78,6 +80,12 @@ public Builder temperature(float temperature) { return this; } + /** Top P value for sampling. */ + public Builder topP(float topP) { + this.topP = topP; + return this; + } + @Override public XaiGenerative build() { return new XaiGenerative(this); From c80b04acb24aac60ecf37afeb6b5fb6a761c0bd4 Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Wed, 26 Nov 2025 23:12:50 +0000 Subject: [PATCH 03/17] Java vectorizer config updates --- .../Multi2VecGoogleVectorizer.java | 10 ++++++++++ .../Text2MultiVecJinaAiVectorizer.java | 10 ++++++++++ .../vectorizers/Text2VecAwsVectorizer.java | 20 +++++++++++++++++++ .../vectorizers/Text2VecCohereVectorizer.java | 2 +- .../vectorizers/Text2VecGoogleVectorizer.java | 10 ++++++++++ 5 files changed, 51 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecGoogleVectorizer.java b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecGoogleVectorizer.java index 9b4530e6a..449a7e756 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecGoogleVectorizer.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecGoogleVectorizer.java @@ -18,6 +18,7 @@ public record Multi2VecGoogleVectorizer( @SerializedName("model") String model, @SerializedName("dimensions") Integer dimensions, @SerializedName("location") String location, + @SerializedName("videoIntervalSeconds") Integer videoIntervalSeconds, /** BLOB image properties included in the embedding. */ @SerializedName("imageFields") List imageFields, /** BLOB video properties included in the embedding. */ @@ -80,6 +81,7 @@ public Multi2VecGoogleVectorizer( String model, Integer dimensions, String location, + Integer videoIntervalSeconds, List imageFields, List videoFields, List textFields, @@ -93,6 +95,7 @@ public Multi2VecGoogleVectorizer( this.model = model; this.dimensions = dimensions; this.location = location; + this.videoIntervalSeconds = videoIntervalSeconds; this.imageFields = imageFields; this.videoFields = videoFields; this.textFields = textFields; @@ -107,6 +110,7 @@ public Multi2VecGoogleVectorizer(Builder builder) { builder.model, builder.dimensions, builder.location, + builder.videoIntervalSeconds, builder.imageFields.keySet().stream().toList(), builder.videoFields.keySet().stream().toList(), builder.textFields.keySet().stream().toList(), @@ -132,6 +136,7 @@ public static class Builder implements ObjectBuilder private String model; private String location; private Integer dimensions; + private Integer videoIntervalSeconds; public Builder(String projectId) { this.projectId = projectId; @@ -152,6 +157,11 @@ public Builder dimensions(int dimensions) { return this; } + public Builder videoIntervalSeconds(int videoIntervalSeconds) { + this.videoIntervalSeconds = videoIntervalSeconds; + return this; + } + /** Add BLOB image properties to include in the embedding. */ public Builder imageFields(List fields) { fields.forEach(field -> imageFields.put(field, null)); diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2MultiVecJinaAiVectorizer.java b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2MultiVecJinaAiVectorizer.java index f8fc5e063..2a85309f1 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2MultiVecJinaAiVectorizer.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2MultiVecJinaAiVectorizer.java @@ -15,6 +15,7 @@ public record Text2MultiVecJinaAiVectorizer( @SerializedName("model") String model, @SerializedName("dimensions") Integer dimensions, + @SerializedName("baseURL") String baseURL, /** * Weaviate defaults to {@code true} if the value is not provided. @@ -54,6 +55,7 @@ public static Text2MultiVecJinaAiVectorizer of( public Text2MultiVecJinaAiVectorizer( String model, Integer dimensions, + String baseURL, boolean vectorizeCollectionName, List sourceProperties, @@ -61,6 +63,7 @@ public Text2MultiVecJinaAiVectorizer( Quantization quantization) { this.model = model; this.dimensions = dimensions; + this.baseURL = baseURL; this.vectorizeCollectionName = false; this.sourceProperties = sourceProperties; @@ -72,6 +75,7 @@ public Text2MultiVecJinaAiVectorizer(Builder builder) { this( builder.model, builder.dimensions, + builder.baseURL, builder.vectorizeCollectionName, builder.sourceProperties, @@ -87,6 +91,7 @@ public static class Builder implements ObjectBuilder sourceProperties, @@ -89,6 +93,8 @@ public Text2VecAwsVectorizer( this.model = model; this.region = region; this.service = service; + this.targetModel = targetModel; + this.targetVariant = targetVariant; this.vectorizeCollectionName = false; this.sourceProperties = sourceProperties; @@ -102,6 +108,8 @@ public Text2VecAwsVectorizer(Builder builder) { builder.model, builder.region, builder.service, + builder.targetModel, + builder.targetVariant, builder.vectorizeCollectionName, builder.sourceProperties, @@ -119,6 +127,8 @@ public abstract static class Builder implements ObjectBuilder Date: Wed, 26 Nov 2025 23:22:00 +0000 Subject: [PATCH 04/17] feat: Updates to Text2VecJinaAiVectorizer and Text2VecTransformersVectorizer parameters --- .../vectorizers/Text2VecJinaAiVectorizer.java | 20 +++++++++++++++++++ .../Text2VecTransformersVectorizer.java | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecJinaAiVectorizer.java b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecJinaAiVectorizer.java index acec520c7..2d8fca69b 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecJinaAiVectorizer.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecJinaAiVectorizer.java @@ -14,6 +14,8 @@ public record Text2VecJinaAiVectorizer( @SerializedName("model") String model, + @SerializedName("baseURL") String baseUrl, + @SerializedName("dimensions") Integer dimensions, /** * Weaviate defaults to {@code true} if the value is not provided. @@ -55,12 +57,16 @@ public static Text2VecJinaAiVectorizer of( */ public Text2VecJinaAiVectorizer( String model, + String baseUrl, + Integer dimensions, boolean vectorizeCollectionName, List sourceProperties, VectorIndex vectorIndex, Quantization quantization) { this.model = model; + this.baseUrl = baseUrl; + this.dimensions = dimensions; this.vectorizeCollectionName = false; this.sourceProperties = sourceProperties; @@ -71,6 +77,8 @@ public Text2VecJinaAiVectorizer( public Text2VecJinaAiVectorizer(Builder builder) { this( builder.model, + builder.baseUrl, + builder.dimensions, builder.vectorizeCollectionName, builder.sourceProperties, @@ -85,12 +93,24 @@ public static class Builder implements ObjectBuilder { private VectorIndex vectorIndex = VectorIndex.DEFAULT_VECTOR_INDEX; private String model; + private Integer dimensions; + private String baseUrl; public Builder model(String model) { this.model = model; return this; } + public Builder baseUrl(String baseUrl) { + this.baseUrl = baseUrl; + return this; + } + + public Builder dimensions(int dimensions) { + this.dimensions = dimensions; + return this; + } + /** Add properties to include in the embedding. */ public Builder sourceProperties(String... properties) { return sourceProperties(Arrays.asList(properties)); diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecTransformersVectorizer.java b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecTransformersVectorizer.java index ce05b956d..3f2a3c683 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecTransformersVectorizer.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecTransformersVectorizer.java @@ -17,6 +17,7 @@ public record Text2VecTransformersVectorizer( @SerializedName("passageInferenceUrl") String passageInferenceUrl, @SerializedName("queryInferenceUrl") String queryInferenceUrl, @SerializedName("poolingStrategy") PoolingStrategy poolingStrategy, + @SerializedName("dimensions") Integer dimensions, /** Properties included in the embedding. */ @SerializedName("sourceProperties") List sourceProperties, @@ -57,6 +58,7 @@ public Text2VecTransformersVectorizer(Builder builder) { builder.passageInferenceUrl, builder.queryInferenceUrl, builder.poolingStrategy, + builder.dimensions, builder.sourceProperties, builder.vectorIndex, builder.quantization); @@ -71,6 +73,7 @@ public static class Builder implements ObjectBuilder Date: Wed, 26 Nov 2025 23:34:00 +0000 Subject: [PATCH 05/17] refactor: Remove outputEncoding field from Multi2VecNvidiaVectorizer and update Text2VecVoyageAiVectorizer baseUrl annotation --- .../vectorizers/Multi2VecNvidiaVectorizer.java | 8 -------- .../vectorizers/Text2VecVoyageAiVectorizer.java | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecNvidiaVectorizer.java b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecNvidiaVectorizer.java index 29dcc9599..42502fc13 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecNvidiaVectorizer.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecNvidiaVectorizer.java @@ -20,7 +20,6 @@ public record Multi2VecNvidiaVectorizer( @SerializedName("model") String model, /** Whether to apply truncation. */ @SerializedName("truncate") Boolean truncate, - @SerializedName("output_encoding") String outputEncoding, /** BLOB properties included in the embedding. */ @SerializedName("imageFields") List imageFields, /** TEXT properties included in the embedding. */ @@ -68,7 +67,6 @@ public Multi2VecNvidiaVectorizer(Builder builder) { builder.baseUrl, builder.model, builder.truncate, - builder.outputEncoding, builder.imageFields.keySet().stream().toList(), builder.textFields.keySet().stream().toList(), new Weights( @@ -88,7 +86,6 @@ public static class Builder implements ObjectBuilder private String baseUrl; private String model; private Boolean truncate; - private String outputEncoding; /** Set base URL of the embedding service. */ public Builder baseUrl(String baseUrl) { @@ -106,11 +103,6 @@ public Builder truncate(Boolean truncate) { return this; } - public Builder outputEncoding(String outputEncoding) { - this.outputEncoding = outputEncoding; - return this; - } - /** Add BLOB properties to include in the embedding. */ public Builder imageFields(List fields) { fields.forEach(field -> imageFields.put(field, null)); diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecVoyageAiVectorizer.java b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecVoyageAiVectorizer.java index 465de0fc2..c9ba25ad1 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecVoyageAiVectorizer.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecVoyageAiVectorizer.java @@ -14,7 +14,7 @@ import io.weaviate.client6.v1.internal.ObjectBuilder; public record Text2VecVoyageAiVectorizer( - @SerializedName("baseUrl") String baseUrl, + @SerializedName("baseURL") String baseUrl, @SerializedName("model") String model, @SerializedName("truncate") Boolean truncate, @SerializedName("dimensions") Integer dimensions, From b239fb25e0cca6de91fbfb94026afe8874a46bd3 Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Wed, 26 Nov 2025 23:36:31 +0000 Subject: [PATCH 06/17] Removed 'outputEncoding' as deprecated and has no effect --- .../vectorizers/Multi2VecVoyageAiVectorizer.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecVoyageAiVectorizer.java b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecVoyageAiVectorizer.java index d32440dcd..e13075ce7 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecVoyageAiVectorizer.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecVoyageAiVectorizer.java @@ -18,7 +18,6 @@ public record Multi2VecVoyageAiVectorizer( @SerializedName("baseURL") String baseUrl, /** Inference model to use. */ @SerializedName("model") String model, - @SerializedName("outputEncoding") String outputEncoding, @SerializedName("truncate") Boolean truncate, /** BLOB properties included in the embedding. */ @SerializedName("imageFields") List imageFields, @@ -71,7 +70,6 @@ public static Multi2VecVoyageAiVectorizer of(Function imageFields, List textFields, @@ -82,7 +80,6 @@ public Multi2VecVoyageAiVectorizer( this.vectorizeCollectionName = false; this.baseUrl = baseUrl; this.model = model; - this.outputEncoding = outputEncoding; this.truncate = truncate; this.imageFields = imageFields; this.textFields = textFields; @@ -95,7 +92,6 @@ public Multi2VecVoyageAiVectorizer(Builder builder) { this( builder.baseUrl, builder.model, - builder.outputEncoding, builder.truncate, builder.imageFields.keySet().stream().toList(), builder.textFields.keySet().stream().toList(), @@ -117,7 +113,6 @@ public static class Builder implements ObjectBuilder Date: Thu, 27 Nov 2025 02:05:19 +0000 Subject: [PATCH 07/17] syntax --- .../client6/v1/api/collections/generative/NvidiaGenerative.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/NvidiaGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/NvidiaGenerative.java index 9ce8ea0e7..f88b5bb70 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/NvidiaGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/NvidiaGenerative.java @@ -13,7 +13,7 @@ public record NvidiaGenerative( @SerializedName("baseURL") String baseUrl, @SerializedName("model") String model, @SerializedName("maxTokens") Integer maxTokens, - @SerializedName("temperature") Float temperature + @SerializedName("temperature") Float temperature, @SerializedName("topP") Float topP) implements Generative { @Override From f8de08b347c83b5d4a303e65acc01d48ef59ef1d Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Thu, 27 Nov 2025 02:15:46 +0000 Subject: [PATCH 08/17] Sting isn't a primitive apparently --- .../api/collections/vectorizers/Text2VecGoogleVectorizer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecGoogleVectorizer.java b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecGoogleVectorizer.java index df472b629..daa1c9999 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecGoogleVectorizer.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecGoogleVectorizer.java @@ -88,7 +88,7 @@ public static Text2VecGoogleVectorizer vertex( public Text2VecGoogleVectorizer( String apiEndpoint, String model, - Sting modelId, + String modelId, String titleProperty, Integer dimensions, TaskType taskType, From c66ea0e4022ad01dd942c907cd5c5e795f45e662 Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Thu, 27 Nov 2025 02:25:48 +0000 Subject: [PATCH 09/17] more bugfixes --- .../api/collections/generative/AnthropicGenerative.java | 8 ++++++++ .../v1/api/collections/generative/XaiGenerative.java | 1 + 2 files changed, 9 insertions(+) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java index b37559cae..8cb2786fa 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java @@ -42,6 +42,7 @@ public static AnthropicGenerative of(Function { private String model; private Integer maxTokens; private Float temperature; + private String baseUrl; private final List stopSequences = new ArrayList<>(); + /** Base URL of the generative provider. */ + public Builder baseUrl(String baseUrl) { + this.baseUrl = baseUrl; + return this; + } + /** Top K value for sampling. */ public Builder topK(int topK) { this.topK = topK; diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/XaiGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/XaiGenerative.java index 981feafac..c1d271f5a 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/XaiGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/XaiGenerative.java @@ -52,6 +52,7 @@ public static class Builder implements ObjectBuilder { private String model; private Integer maxTokens; private Float temperature; + private Float topP; /** Base URL of the generative provider. */ public Builder baseUrl(String baseUrl) { From f3e7a5ae5bb43d44b835876475edb68d2aa27863 Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Thu, 27 Nov 2025 02:38:40 +0000 Subject: [PATCH 10/17] Update tests --- .../client6/v1/internal/json/JSONTest.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java b/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java index 1439e9a00..ce91f4ccd 100644 --- a/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java +++ b/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java @@ -1004,12 +1004,12 @@ public static Object[][] testCases() { """ { "generative-cohere": { - "kProperty": 1, - "maxTokensProperty": 2, - "temperatureProperty": 3.0, + "k": 1, + "maxTokens": 2, + "temperature": 3.0, "model": "example-model", - "returnLikelihoodsProperty": "likelihood", - "stopSequencesProperty": ["stop", "halt"] + "returnLikelihoods": "likelihood", + "stopSequences": ["stop", "halt"] } } """, @@ -1160,11 +1160,11 @@ public static Object[][] testCases() { { "generative-openai": { "baseURL": "https://example.com", - "frequencyPenaltyProperty": 1.0, - "presencePenaltyProperty": 2.0, - "temperatureProperty": 3.0, - "topPProperty": 4.0, - "maxTokensProperty": 5, + "frequencyPenalty": 1.0, + "presencePenalty": 2.0, + "temperature": 3.0, + "topP": 4.0, + "maxTokens": 5, "model": "o3-mini" } } @@ -1186,11 +1186,11 @@ public static Object[][] testCases() { { "generative-openai": { "baseURL": "https://example.com", - "frequencyPenaltyProperty": 1.0, - "presencePenaltyProperty": 2.0, - "temperatureProperty": 3.0, - "topPProperty": 4.0, - "maxTokensProperty": 5, + "frequencyPenalty": 1.0, + "presencePenalty": 2.0, + "temperature": 3.0, + "topP": 4.0, + "maxTokens": 5, "resourceName": "azure-resource", "deploymentId": "azure-deployment" } From 1f522f1bc535c287b5c05c62189d630b1dbbc94b Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Thu, 27 Nov 2025 02:53:55 +0000 Subject: [PATCH 11/17] Refactor stopSequences initialization in generative classes --- .../generative/AnthropicGenerative.java | 20 +++++++++++++++---- .../collections/generative/AwsGenerative.java | 5 ++++- .../generative/CohereGenerative.java | 12 ++++++++--- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java index 8cb2786fa..8312558d3 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java @@ -58,7 +58,7 @@ public static class Builder implements ObjectBuilder { private Integer maxTokens; private Float temperature; private String baseUrl; - private final List stopSequences = new ArrayList<>(); + private List stopSequences; /** Base URL of the generative provider. */ public Builder baseUrl(String baseUrl) { @@ -101,6 +101,9 @@ public Builder stopSequences(String... stopSequences) { * Set tokens which should signal the model to stop generating further output. */ public Builder stopSequences(List stopSequences) { + if (this.stopSequences == null) { + this.stopSequences = new ArrayList<>(); + } this.stopSequences.addAll(stopSequences); return this; } @@ -199,9 +202,9 @@ public static class Builder implements ObjectBuilder stopSequences = new ArrayList<>(); - private final List images = new ArrayList<>(); - private final List imageProperties = new ArrayList<>(); + private List stopSequences; + private List images; + private List imageProperties; /** Base URL of the generative provider. */ public Builder baseUrl(String baseUrl) { @@ -244,6 +247,9 @@ public Builder stopSequences(String... stopSequences) { * Set tokens which should signal the model to stop generating further output. */ public Builder stopSequences(List stopSequences) { + if (this.stopSequences == null) { + this.stopSequences = new ArrayList<>(); + } this.stopSequences.addAll(stopSequences); return this; } @@ -253,6 +259,9 @@ public Builder images(String... images) { } public Builder images(List images) { + if (this.images == null) { + this.images = new ArrayList<>(); + } this.images.addAll(images); return this; } @@ -262,6 +271,9 @@ public Builder imageProperties(String... imageProperties) { } public Builder imageProperties(List imageProperties) { + if (this.imageProperties == null) { + this.imageProperties = new ArrayList<>(); + } this.imageProperties.addAll(imageProperties); return this; } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AwsGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AwsGenerative.java index 0e3dd747f..c6681f55c 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AwsGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AwsGenerative.java @@ -90,7 +90,7 @@ public Builder(Service service, String region) { private Integer maxTokensToSample; private Float topP; private Integer topK; - private final List stopSequences = new ArrayList<>(); + private List stopSequences; /** Base URL of the generative provider. */ protected Builder endpoint(String endpoint) { @@ -153,6 +153,9 @@ public Builder stopSequences(String... stopSequences) { /** Stop sequences for the model. */ public Builder stopSequences(List stopSequences) { + if (this.stopSequences == null) { + this.stopSequences = new ArrayList<>(); + } this.stopSequences.addAll(stopSequences); return this; } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/CohereGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/CohereGenerative.java index d1605df8d..b86124fa8 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/CohereGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/CohereGenerative.java @@ -58,7 +58,7 @@ public static class Builder implements ObjectBuilder { private Integer maxTokens; private Float temperature; private String returnLikelihoodsProperty; - private List stopSequences = new ArrayList<>(); + private List stopSequences; /** Base URL of the generative provider. */ public Builder baseUrl(String baseUrl) { @@ -100,7 +100,10 @@ public Builder stopSequences(String... stopSequences) { * Set tokens which should signal the model to stop generating further output. */ public Builder stopSequences(List stopSequences) { - this.stopSequences = stopSequences; + if (this.stopSequences == null) { + this.stopSequences = new ArrayList<>(); + } + this.stopSequences.addAll(stopSequences); return this; } @@ -208,7 +211,7 @@ public static class Builder implements ObjectBuilder private Float temperature; private Float frequencyPenalty; private Float presencePenalty; - private final List stopSequences = new ArrayList<>(); + private List stopSequences; /** Base URL of the generative provider. */ public Builder baseUrl(String baseUrl) { @@ -262,6 +265,9 @@ public Builder stopSequences(String... stopSequences) { * Set tokens which should signal the model to stop generating further output. */ public Builder stopSequences(List stopSequences) { + if (this.stopSequences == null) { + this.stopSequences = new ArrayList<>(); + } this.stopSequences.addAll(stopSequences); return this; } From 745ed85214450344c6c5d139feae3aa2565eff08 Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Thu, 27 Nov 2025 03:36:17 +0000 Subject: [PATCH 12/17] Update generative module references from "generative-palm" to "generative-google" and enhance JSON tests with additional parameters --- .../v1/api/collections/Generative.java | 14 +++--- .../generate/GenerativeProvider.java | 4 +- .../client6/v1/internal/json/JSONTest.java | 44 ++++++++++++++++--- 3 files changed, 46 insertions(+), 16 deletions(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/Generative.java b/src/main/java/io/weaviate/client6/v1/api/collections/Generative.java index c4462f7d4..55c622ff7 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/Generative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/Generative.java @@ -39,7 +39,7 @@ public enum Kind implements JsonEnum { COHERE("generative-cohere"), DATABRICKS("generative-databricks"), FRIENDLIAI("generative-friendliai"), - GOOGLE("generative-palm"), + GOOGLE("generative-google"), MISTRAL("generative-mistral"), NVIDIA("generative-nvidia"), OLLAMA("generative-ollama"), @@ -185,13 +185,13 @@ public static Generative friendliai(Function cfg + .baseUrl("https://example.com") .topK(1) .maxTokens(2) .temperature(3f) @@ -949,6 +950,7 @@ public static Object[][] testCases() { """ { "generative-anthropic": { + "baseURL": "https://example.com", "topK": 1, "maxTokens": 2, "temperature": 3.0, @@ -964,13 +966,23 @@ public static Object[][] testCases() { "aws-region", "example-model", cfg -> cfg - .model("example-model")), + .model("example-model"), + .temperature(0.7f) + .maxTokenCount(100) + .topK(50) + .topP(0.9f) + .stopSequences("STOP", "END")), """ { "generative-aws": { "model": "example-model", "region": "aws-region", - "service": "bedrock" + "service": "bedrock", + "temperature": 0.7, + "maxTokenCount": 100, + "topK": 50, + "topP": 0.9, + "stopSequences": ["STOP", "END"] } } """, @@ -981,13 +993,21 @@ public static Object[][] testCases() { "aws-region", "https://example.com", cfg -> cfg - .endpoint("https://example.com")), + .endpoint("https://example.com") + .targetModel("custom-model") + .targetVariant("variant-1") + .maxTokensToSample(200) + .stopSequences("STOP")), """ { "generative-aws": { "endpoint": "https://example.com", "region": "aws-region", - "service": "sagemaker" + "service": "sagemaker", + "targetModel": "custom-model", + "targetVariant": "variant-1", + "maxTokensToSample": 200, + "stopSequences": ["STOP"] } } """, @@ -1077,6 +1097,7 @@ public static Object[][] testCases() { .baseUrl("https://example.com") .maxTokens(2) .temperature(3f) + .topP(0.95f) .model("example-model")), """ { @@ -1084,6 +1105,7 @@ public static Object[][] testCases() { "baseURL": "https://example.com", "maxTokens": 2, "temperature": 3.0, + "topP": 0.95, "model": "example-model" } } @@ -1099,17 +1121,23 @@ public static Object[][] testCases() { .temperature(3f) .topK(4) .topP(5f) - .modelId("example-model")), + .modelId("example-model") + .endpointId("endpoint-123") + .region("us-central1") + .model("gemini-pro")), """ { - "generative-palm": { + "generative-google": { "apiEndpoint": "https://example.com", "maxOutputTokens": 2, "temperature": 3.0, "topK": 4, "topP": 5, "projectId": "google-project", - "modelId": "example-model" + "modelId": "example-model", + "endpointId": "endpoint-123", + "region": "us-central1", + "model": "gemini-pro" } } """, @@ -1134,6 +1162,7 @@ public static Object[][] testCases() { .baseUrl("https://example.com") .maxTokens(2) .temperature(3f) + .topP(0.9f) .model("example-model")), """ { @@ -1141,6 +1170,7 @@ public static Object[][] testCases() { "baseURL": "https://example.com", "maxTokens": 2, "temperature": 3.0, + "topP": 0.9, "model": "example-model" } } From 7a9fde3a7a50c362947a7134d61cc7e74c0ef02f Mon Sep 17 00:00:00 2001 From: JP Hwang Date: Thu, 27 Nov 2025 03:45:26 +0000 Subject: [PATCH 13/17] typo :/ --- .../java/io/weaviate/client6/v1/internal/json/JSONTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java b/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java index 2b7954108..8dbd2e1cd 100644 --- a/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java +++ b/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java @@ -966,7 +966,7 @@ public static Object[][] testCases() { "aws-region", "example-model", cfg -> cfg - .model("example-model"), + .model("example-model") .temperature(0.7f) .maxTokenCount(100) .topK(50) From 6b05f7830f1872341f0bd3bd1a227a17b6e981a9 Mon Sep 17 00:00:00 2001 From: Ivan Despot <66276597+g-despot@users.noreply.github.com> Date: Thu, 27 Nov 2025 10:48:27 +0100 Subject: [PATCH 14/17] Minor fixes --- .../generative/AzureOpenAiGenerative.java | 18 +++++++ .../generative/OpenAiGenerative.java | 52 +++++++++++++++++-- .../collections/rerankers/CohereReranker.java | 2 +- .../Text2VecAzureOpenAiVectorizer.java | 22 ++++++++ 4 files changed, 90 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AzureOpenAiGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AzureOpenAiGenerative.java index 651a54d9b..cce9ad86c 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AzureOpenAiGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AzureOpenAiGenerative.java @@ -14,12 +14,14 @@ import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative; public record AzureOpenAiGenerative( + @SerializedName("apiVersion") String apiVersion, @SerializedName("baseURL") String baseUrl, @SerializedName("frequencyPenalty") Float frequencyPenalty, @SerializedName("presencePenalty") Float presencePenalty, @SerializedName("maxTokens") Integer maxTokens, @SerializedName("temperature") Float temperature, @SerializedName("topP") Float topP, + @SerializedName("model") String model, @SerializedName("resourceName") String resourceName, @SerializedName("deploymentId") String deploymentId) implements Generative { @@ -45,12 +47,14 @@ public static AzureOpenAiGenerative of(String resourceName, String deploymentId, public AzureOpenAiGenerative(Builder builder) { this( + builder.apiVersion, builder.baseUrl, builder.frequencyPenalty, builder.presencePenalty, builder.maxTokens, builder.temperature, builder.topP, + builder.model, builder.resourceName, builder.deploymentId); } @@ -59,24 +63,38 @@ public static class Builder implements ObjectBuilder { private final String resourceName; private final String deploymentId; + private String apiVersion; private String baseUrl; private Float frequencyPenalty; private Float presencePenalty; private Integer maxTokens; private Float temperature; private Float topP; + private String model; public Builder(String resourceName, String deploymentId) { this.resourceName = resourceName; this.deploymentId = deploymentId; } + /** API version for the generative provider. */ + public Builder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + /** Base URL of the generative provider. */ public Builder baseUrl(String baseUrl) { this.baseUrl = baseUrl; return this; } + /** Select generative model. */ + public Builder model(String model) { + this.model = model; + return this; + } + /** Limit the number of tokens to generate in the response. */ public Builder maxTokens(int maxTokens) { this.maxTokens = maxTokens; diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/OpenAiGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/OpenAiGenerative.java index 324c8cedc..670abefca 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/OpenAiGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/OpenAiGenerative.java @@ -14,14 +14,16 @@ import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative; public record OpenAiGenerative( + @SerializedName("apiVersion") String apiVersion, @SerializedName("baseURL") String baseUrl, @SerializedName("frequencyPenalty") Float frequencyPenalty, @SerializedName("presencePenalty") Float presencePenalty, @SerializedName("maxTokens") Integer maxTokens, @SerializedName("temperature") Float temperature, @SerializedName("topP") Float topP, - - @SerializedName("model") String model) implements Generative { + @SerializedName("model") String model, + @SerializedName("reasoningEffort") ReasoningEffort reasoningEffort, + @SerializedName("verbosity") Verbosity verbosity) implements Generative { @Override public Kind _kind() { @@ -43,16 +45,20 @@ public static OpenAiGenerative of(Function { + private String apiVersion; private String baseUrl; private Float frequencyPenalty; private Float presencePenalty; @@ -60,6 +66,14 @@ public static class Builder implements ObjectBuilder { private Float temperature; private Float topP; private String model; + private ReasoningEffort reasoningEffort; + private Verbosity verbosity; + + /** API version for the generative provider. */ + public Builder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } /** Base URL of the generative provider. */ public Builder baseUrl(String baseUrl) { @@ -73,6 +87,18 @@ public Builder model(String model) { return this; } + /** Set the reasoning effort level. */ + public Builder reasoningEffort(ReasoningEffort reasoningEffort) { + this.reasoningEffort = reasoningEffort; + return this; + } + + /** Set the verbosity level. */ + public Builder verbosity(Verbosity verbosity) { + this.verbosity = verbosity; + return this; + } + /** Limit the number of tokens to generate in the response. */ public Builder maxTokens(int maxTokens) { this.maxTokens = maxTokens; @@ -110,6 +136,26 @@ public OpenAiGenerative build() { } } + public enum ReasoningEffort { + @SerializedName("minimal") + MINIMAL, + @SerializedName("low") + LOW, + @SerializedName("medium") + MEDIUM, + @SerializedName("high") + HIGH; + } + + public enum Verbosity { + @SerializedName("low") + LOW, + @SerializedName("medium") + MEDIUM, + @SerializedName("high") + HIGH; + } + public static record Metadata(ProviderMetadata.Usage usage) implements ProviderMetadata { } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/rerankers/CohereReranker.java b/src/main/java/io/weaviate/client6/v1/api/collections/rerankers/CohereReranker.java index ba435e572..5cdf60c16 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/rerankers/CohereReranker.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/rerankers/CohereReranker.java @@ -11,7 +11,7 @@ public record CohereReranker( @SerializedName("model") String model) implements Reranker { public static final String RERANK_ENGLISH_V2 = "rerank-english-v2.0"; - public static final String RERANK_MULTILINGUAL_V2 = "rerank-mulilingual-v2.0"; + public static final String RERANK_MULTILINGUAL_V2 = "rerank-multilingual-v2.0"; @Override public Kind _kind() { diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecAzureOpenAiVectorizer.java b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecAzureOpenAiVectorizer.java index 121ad478a..5b7fa72f8 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecAzureOpenAiVectorizer.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecAzureOpenAiVectorizer.java @@ -14,6 +14,8 @@ public record Text2VecAzureOpenAiVectorizer( @SerializedName("baseURL") String baseUrl, + @SerializedName("dimensions") Integer dimensions, + @SerializedName("model") String model, @SerializedName("deploymentId") String deploymentId, @SerializedName("resourceName") String resourceName, @@ -54,6 +56,8 @@ public static Text2VecAzureOpenAiVectorizer of( */ public Text2VecAzureOpenAiVectorizer( String baseUrl, + Integer dimensions, + String model, String deploymentId, String resourceName, @@ -62,6 +66,8 @@ public Text2VecAzureOpenAiVectorizer( VectorIndex vectorIndex, Quantization quantization) { this.baseUrl = baseUrl; + this.dimensions = dimensions; + this.model = model; this.deploymentId = deploymentId; this.resourceName = resourceName; @@ -74,6 +80,8 @@ public Text2VecAzureOpenAiVectorizer( public Text2VecAzureOpenAiVectorizer(Builder builder) { this( builder.baseUrl, + builder.dimensions, + builder.model, builder.deploymentId, builder.resourceName, @@ -90,6 +98,8 @@ public static class Builder implements ObjectBuilder Date: Thu, 27 Nov 2025 10:52:17 +0100 Subject: [PATCH 15/17] Fix typo --- .../collections/vectorizers/Text2VecOpenAiVectorizer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecOpenAiVectorizer.java b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecOpenAiVectorizer.java index 12892d897..f2eed9719 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecOpenAiVectorizer.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2VecOpenAiVectorizer.java @@ -37,9 +37,9 @@ public VectorConfig.Kind _kind() { return VectorConfig.Kind.TEXT2VEC_OPENAI; } - public static String TEXT_EMBEDDING_3_SMALL = "text-embeding-3-small"; - public static String TEXT_EMBEDDING_3_LARGE = "text-embeding-3-large"; - public static String TEXT_EMBEDDING_ADA_002 = "text-embeding-ada-002"; + public static String TEXT_EMBEDDING_3_SMALL = "text-embedding-3-small"; + public static String TEXT_EMBEDDING_3_LARGE = "text-embedding-3-large"; + public static String TEXT_EMBEDDING_ADA_002 = "text-embedding-ada-002"; @Override public Object _self() { From df5cf42a85abfa223c44ef4fa262821c61e0ac1a Mon Sep 17 00:00:00 2001 From: Ivan Despot <66276597+g-despot@users.noreply.github.com> Date: Thu, 27 Nov 2025 11:11:56 +0100 Subject: [PATCH 16/17] Fix Cohere and remove lazy list initialization --- .../generative/AnthropicGenerative.java | 20 ++-------- .../collections/generative/AwsGenerative.java | 5 +-- .../generative/CohereGenerative.java | 39 ++++++++++++++----- 3 files changed, 34 insertions(+), 30 deletions(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java index 8312558d3..8cb2786fa 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AnthropicGenerative.java @@ -58,7 +58,7 @@ public static class Builder implements ObjectBuilder { private Integer maxTokens; private Float temperature; private String baseUrl; - private List stopSequences; + private final List stopSequences = new ArrayList<>(); /** Base URL of the generative provider. */ public Builder baseUrl(String baseUrl) { @@ -101,9 +101,6 @@ public Builder stopSequences(String... stopSequences) { * Set tokens which should signal the model to stop generating further output. */ public Builder stopSequences(List stopSequences) { - if (this.stopSequences == null) { - this.stopSequences = new ArrayList<>(); - } this.stopSequences.addAll(stopSequences); return this; } @@ -202,9 +199,9 @@ public static class Builder implements ObjectBuilder stopSequences; - private List images; - private List imageProperties; + private final List stopSequences = new ArrayList<>(); + private final List images = new ArrayList<>(); + private final List imageProperties = new ArrayList<>(); /** Base URL of the generative provider. */ public Builder baseUrl(String baseUrl) { @@ -247,9 +244,6 @@ public Builder stopSequences(String... stopSequences) { * Set tokens which should signal the model to stop generating further output. */ public Builder stopSequences(List stopSequences) { - if (this.stopSequences == null) { - this.stopSequences = new ArrayList<>(); - } this.stopSequences.addAll(stopSequences); return this; } @@ -259,9 +253,6 @@ public Builder images(String... images) { } public Builder images(List images) { - if (this.images == null) { - this.images = new ArrayList<>(); - } this.images.addAll(images); return this; } @@ -271,9 +262,6 @@ public Builder imageProperties(String... imageProperties) { } public Builder imageProperties(List imageProperties) { - if (this.imageProperties == null) { - this.imageProperties = new ArrayList<>(); - } this.imageProperties.addAll(imageProperties); return this; } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AwsGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AwsGenerative.java index c6681f55c..0e3dd747f 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/AwsGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/AwsGenerative.java @@ -90,7 +90,7 @@ public Builder(Service service, String region) { private Integer maxTokensToSample; private Float topP; private Integer topK; - private List stopSequences; + private final List stopSequences = new ArrayList<>(); /** Base URL of the generative provider. */ protected Builder endpoint(String endpoint) { @@ -153,9 +153,6 @@ public Builder stopSequences(String... stopSequences) { /** Stop sequences for the model. */ public Builder stopSequences(List stopSequences) { - if (this.stopSequences == null) { - this.stopSequences = new ArrayList<>(); - } this.stopSequences.addAll(stopSequences); return this; } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/generative/CohereGenerative.java b/src/main/java/io/weaviate/client6/v1/api/collections/generative/CohereGenerative.java index b86124fa8..2811a61b6 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/generative/CohereGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/generative/CohereGenerative.java @@ -20,7 +20,10 @@ public record CohereGenerative( @SerializedName("maxTokens") Integer maxTokens, @SerializedName("temperature") Float temperature, @SerializedName("returnLikelihoods") String returnLikelihoodsProperty, - @SerializedName("stopSequences") List stopSequences) implements Generative { + @SerializedName("stopSequences") List stopSequences, + @SerializedName("P") Float topP, + @SerializedName("presencePenalty") Float presencePenalty, + @SerializedName("frequencyPenalty") Float frequencyPenalty) implements Generative { @Override public Kind _kind() { @@ -48,7 +51,10 @@ public CohereGenerative(Builder builder) { builder.maxTokens, builder.temperature, builder.returnLikelihoodsProperty, - builder.stopSequences); + builder.stopSequences, + builder.topP, + builder.presencePenalty, + builder.frequencyPenalty); } public static class Builder implements ObjectBuilder { @@ -58,7 +64,10 @@ public static class Builder implements ObjectBuilder { private Integer maxTokens; private Float temperature; private String returnLikelihoodsProperty; - private List stopSequences; + private final List stopSequences = new ArrayList<>(); + private Float topP; + private Float presencePenalty; + private Float frequencyPenalty; /** Base URL of the generative provider. */ public Builder baseUrl(String baseUrl) { @@ -72,6 +81,12 @@ public Builder topK(int topK) { return this; } + /** Top P value for nucleus sampling. */ + public Builder topP(float topP) { + this.topP = topP; + return this; + } + /** Select generative model. */ public Builder model(String model) { this.model = model; @@ -100,9 +115,6 @@ public Builder stopSequences(String... stopSequences) { * Set tokens which should signal the model to stop generating further output. */ public Builder stopSequences(List stopSequences) { - if (this.stopSequences == null) { - this.stopSequences = new ArrayList<>(); - } this.stopSequences.addAll(stopSequences); return this; } @@ -116,6 +128,16 @@ public Builder temperature(float temperature) { return this; } + public Builder presencePenalty(float presencePenalty) { + this.presencePenalty = presencePenalty; + return this; + } + + public Builder frequencyPenalty(float frequencyPenalty) { + this.frequencyPenalty = frequencyPenalty; + return this; + } + @Override public CohereGenerative build() { return new CohereGenerative(this); @@ -211,7 +233,7 @@ public static class Builder implements ObjectBuilder private Float temperature; private Float frequencyPenalty; private Float presencePenalty; - private List stopSequences; + private final List stopSequences = new ArrayList<>(); /** Base URL of the generative provider. */ public Builder baseUrl(String baseUrl) { @@ -265,9 +287,6 @@ public Builder stopSequences(String... stopSequences) { * Set tokens which should signal the model to stop generating further output. */ public Builder stopSequences(List stopSequences) { - if (this.stopSequences == null) { - this.stopSequences = new ArrayList<>(); - } this.stopSequences.addAll(stopSequences); return this; } From d8b68dc49992d6eff1e08f421819ef7da44ac279 Mon Sep 17 00:00:00 2001 From: Ivan Despot <66276597+g-despot@users.noreply.github.com> Date: Thu, 27 Nov 2025 11:14:06 +0100 Subject: [PATCH 17/17] Fix baseURL --- .../vectorizers/Text2MultiVecJinaAiVectorizer.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2MultiVecJinaAiVectorizer.java b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2MultiVecJinaAiVectorizer.java index 2a85309f1..33d9e1fae 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2MultiVecJinaAiVectorizer.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Text2MultiVecJinaAiVectorizer.java @@ -15,7 +15,7 @@ public record Text2MultiVecJinaAiVectorizer( @SerializedName("model") String model, @SerializedName("dimensions") Integer dimensions, - @SerializedName("baseURL") String baseURL, + @SerializedName("baseURL") String baseUrl, /** * Weaviate defaults to {@code true} if the value is not provided. @@ -55,7 +55,7 @@ public static Text2MultiVecJinaAiVectorizer of( public Text2MultiVecJinaAiVectorizer( String model, Integer dimensions, - String baseURL, + String baseUrl, boolean vectorizeCollectionName, List sourceProperties, @@ -63,7 +63,7 @@ public Text2MultiVecJinaAiVectorizer( Quantization quantization) { this.model = model; this.dimensions = dimensions; - this.baseURL = baseURL; + this.baseUrl = baseUrl; this.vectorizeCollectionName = false; this.sourceProperties = sourceProperties; @@ -75,7 +75,7 @@ public Text2MultiVecJinaAiVectorizer(Builder builder) { this( builder.model, builder.dimensions, - builder.baseURL, + builder.baseUrl, builder.vectorizeCollectionName, builder.sourceProperties, @@ -91,7 +91,7 @@ public static class Builder implements ObjectBuilder