diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/LlmUtilityServiceClient.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/LlmUtilityServiceClient.java index aca6a1d56e97..99ca0c7e3332 100644 --- a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/LlmUtilityServiceClient.java +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/LlmUtilityServiceClient.java @@ -315,7 +315,7 @@ public LlmUtilityServiceStub getStub() { * * @param endpoint Required. The name of the Endpoint requested to perform token counting. Format: * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param instances Required. The instances that are the input to token counting call. Schema is + * @param instances Optional. The instances that are the input to token counting call. Schema is * identical to the prediction schema of the underlying model. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -351,7 +351,7 @@ public final CountTokensResponse countTokens(EndpointName endpoint, List * * @param endpoint Required. The name of the Endpoint requested to perform token counting. Format: * `projects/{project}/locations/{location}/endpoints/{endpoint}` - * @param instances Required. The instances that are the input to token counting call. Schema is + * @param instances Optional. The instances that are the input to token counting call. Schema is * identical to the prediction schema of the underlying model. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -383,6 +383,8 @@ public final CountTokensResponse countTokens(String endpoint, List instan * .setModel("model104069929") * .addAllInstances(new ArrayList()) * .addAllContents(new ArrayList()) + * .setSystemInstruction(Content.newBuilder().build()) + * .addAllTools(new ArrayList()) * .build(); * CountTokensResponse response = llmUtilityServiceClient.countTokens(request); * } @@ -417,6 +419,8 @@ public final CountTokensResponse countTokens(CountTokensRequest request) { * .setModel("model104069929") * .addAllInstances(new ArrayList()) * .addAllContents(new ArrayList()) + * .setSystemInstruction(Content.newBuilder().build()) + * .addAllTools(new ArrayList()) * .build(); * ApiFuture future = * llmUtilityServiceClient.countTokensCallable().futureCall(request); @@ -451,7 +455,7 @@ public final UnaryCallable countTokensC * * @param endpoint Required. The name of the Endpoint requested to get lists of tokens and token * ids. - * @param instances Required. The instances that are the input to token computing API call. Schema + * @param instances Optional. The instances that are the input to token computing API call. Schema * is identical to the prediction schema of the text model, even for the non-text models, like * chat models, or Codey models. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -488,7 +492,7 @@ public final ComputeTokensResponse computeTokens(EndpointName endpoint, List in * "[PROJECT]", "[LOCATION]", "[ENDPOINT]") * .toString()) * .addAllInstances(new ArrayList()) + * .setModel("model104069929") + * .addAllContents(new ArrayList()) * .build(); * ComputeTokensResponse response = llmUtilityServiceClient.computeTokens(request); * } @@ -551,6 +557,8 @@ public final ComputeTokensResponse computeTokens(ComputeTokensRequest request) { * "[PROJECT]", "[LOCATION]", "[ENDPOINT]") * .toString()) * .addAllInstances(new ArrayList()) + * .setModel("model104069929") + * .addAllContents(new ArrayList()) * .build(); * ApiFuture future = * llmUtilityServiceClient.computeTokensCallable().futureCall(request); diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/PredictionServiceClient.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/PredictionServiceClient.java index b8e46ee1d9fa..d5f3253b2838 100644 --- a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/PredictionServiceClient.java +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/PredictionServiceClient.java @@ -1378,8 +1378,12 @@ public final UnaryCallable explainCallable() { * } * } * - * @param model Required. The name of the publisher model requested to serve the prediction. - * Format: `projects/{project}/locations/{location}/publishers/*/models/*` + * @param model Required. The fully qualified name of the publisher model or tuned model endpoint + * to use. + *

Publisher model format: + * `projects/{project}/locations/{location}/publishers/*/models/*` + *

Tuned model endpoint format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` * @param contents Required. The content of the current conversation with the model. *

For single-turn queries, this is a single instance. For multi-turn queries, this is a * repeated field that contains conversation history + latest request. diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/EndpointServiceStubSettings.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/EndpointServiceStubSettings.java index f0c144b09d7b..f846a475707e 100644 --- a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/EndpointServiceStubSettings.java +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/EndpointServiceStubSettings.java @@ -22,6 +22,7 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -402,6 +403,7 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild } /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") public static String getDefaultEndpoint() { return "aiplatform.googleapis.com:443"; } diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcPredictionServiceStub.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcPredictionServiceStub.java index ee048918e7ed..7b0843c0f1ae 100644 --- a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcPredictionServiceStub.java +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/GrpcPredictionServiceStub.java @@ -385,24 +385,12 @@ protected GrpcPredictionServiceStub( streamDirectPredictTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(streamDirectPredictMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("endpoint", String.valueOf(request.getEndpoint())); - return builder.build(); - }) .build(); GrpcCallSettings streamDirectRawPredictTransportSettings = GrpcCallSettings .newBuilder() .setMethodDescriptor(streamDirectRawPredictMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add("endpoint", String.valueOf(request.getEndpoint())); - return builder.build(); - }) .build(); GrpcCallSettings streamingPredictTransportSettings = diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonEndpointServiceStub.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonEndpointServiceStub.java index 73ef272ae5d1..ff7758ceb5e3 100644 --- a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonEndpointServiceStub.java +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonEndpointServiceStub.java @@ -119,12 +119,13 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "endpointId", request.getEndpointId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("endpoint", request.getEndpoint(), false)) + .toBody("endpoint", request.getEndpoint(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -158,6 +159,7 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -196,6 +198,7 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "readMask", request.getReadMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -231,12 +234,13 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("endpoint", request.getEndpoint(), false)) + .toBody("endpoint", request.getEndpoint(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -267,6 +271,7 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -303,12 +308,13 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .toBody("*", request.toBuilder().clearEndpoint().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -342,12 +348,13 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .toBody("*", request.toBuilder().clearEndpoint().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -381,12 +388,13 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .toBody("*", request.toBuilder().clearEndpoint().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -421,6 +429,7 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -455,6 +464,7 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -487,6 +497,8 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { "/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy", "/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy", "/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy", "/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy", "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy", "/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy", @@ -499,12 +511,13 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), false)) + .toBody("*", request.toBuilder().clearResource().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -534,6 +547,8 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { "/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy", "/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy", "/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy", "/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy", "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy", "/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy", @@ -547,6 +562,7 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -579,6 +595,8 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { "/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions", "/v1/{resource=projects/*/locations/*/models/*}:testIamPermissions", "/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions", "/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions", "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions", "/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions", @@ -591,6 +609,7 @@ public class HttpJsonEndpointServiceStub extends EndpointServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -838,6 +857,21 @@ protected HttpJsonEndpointServiceStub( .setPost( "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setPost( @@ -1017,6 +1051,21 @@ protected HttpJsonEndpointServiceStub( .setPost( "/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setPost( @@ -1221,6 +1270,21 @@ protected HttpJsonEndpointServiceStub( .setDelete( "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setDelete( @@ -1415,6 +1479,21 @@ protected HttpJsonEndpointServiceStub( .setDelete( "/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete( + "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setDelete( @@ -1645,6 +1724,21 @@ protected HttpJsonEndpointServiceStub( .setGet( "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setGet( @@ -1840,6 +1934,21 @@ protected HttpJsonEndpointServiceStub( .setGet( "/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setGet("/v1/{name=projects/*/locations/*/studies/*/operations/*}") @@ -2060,6 +2169,21 @@ protected HttpJsonEndpointServiceStub( .setGet( "/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setGet("/ui/{name=projects/*/locations/*/studies/*}/operations") @@ -2251,6 +2375,21 @@ protected HttpJsonEndpointServiceStub( .setGet( "/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setGet("/v1/{name=projects/*/locations/*/studies/*}/operations") @@ -2479,6 +2618,21 @@ protected HttpJsonEndpointServiceStub( .setPost( "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setPost( @@ -2673,6 +2827,21 @@ protected HttpJsonEndpointServiceStub( .setPost( "/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait") .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost( + "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait") + .build()) .addAdditionalBindings( HttpRule.newBuilder() .setPost( diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonLlmUtilityServiceStub.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonLlmUtilityServiceStub.java index cc0c77d61174..977f155a2337 100644 --- a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonLlmUtilityServiceStub.java +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonLlmUtilityServiceStub.java @@ -80,18 +80,21 @@ public class HttpJsonLlmUtilityServiceStub extends LlmUtilityServiceStub { return fields; }) .setAdditionalPaths( - "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:countTokens") + "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:countTokens", + "/v1/{endpoint=endpoints/*}:countTokens", + "/v1/{endpoint=publishers/*/models/*}:countTokens") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .toBody("*", request.toBuilder().clearEndpoint().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -118,18 +121,21 @@ public class HttpJsonLlmUtilityServiceStub extends LlmUtilityServiceStub { return fields; }) .setAdditionalPaths( - "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:computeTokens") + "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:computeTokens", + "/v1/{endpoint=endpoints/*}:computeTokens", + "/v1/{endpoint=publishers/*/models/*}:computeTokens") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .toBody("*", request.toBuilder().clearEndpoint().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -161,6 +167,7 @@ public class HttpJsonLlmUtilityServiceStub extends LlmUtilityServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -195,6 +202,7 @@ public class HttpJsonLlmUtilityServiceStub extends LlmUtilityServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -227,6 +235,8 @@ public class HttpJsonLlmUtilityServiceStub extends LlmUtilityServiceStub { "/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy", "/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy", "/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy", "/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy", "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy", "/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy", @@ -239,12 +249,13 @@ public class HttpJsonLlmUtilityServiceStub extends LlmUtilityServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), false)) + .toBody("*", request.toBuilder().clearResource().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -274,6 +285,8 @@ public class HttpJsonLlmUtilityServiceStub extends LlmUtilityServiceStub { "/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy", "/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy", "/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy", "/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy", "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy", "/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy", @@ -287,6 +300,7 @@ public class HttpJsonLlmUtilityServiceStub extends LlmUtilityServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -319,6 +333,8 @@ public class HttpJsonLlmUtilityServiceStub extends LlmUtilityServiceStub { "/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions", "/v1/{resource=projects/*/locations/*/models/*}:testIamPermissions", "/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions", "/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions", "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions", "/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions", @@ -331,6 +347,7 @@ public class HttpJsonLlmUtilityServiceStub extends LlmUtilityServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonPredictionServiceStub.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonPredictionServiceStub.java index 89de31aedef8..d032e1c8e06d 100644 --- a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonPredictionServiceStub.java +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/HttpJsonPredictionServiceStub.java @@ -105,12 +105,13 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .toBody("*", request.toBuilder().clearEndpoint().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -142,12 +143,13 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .toBody("*", request.toBuilder().clearEndpoint().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -180,12 +182,13 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .toBody("*", request.toBuilder().clearEndpoint().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -211,19 +214,18 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { serializer.putPathParam(fields, "endpoint", request.getEndpoint()); return fields; }) - .setAdditionalPaths( - "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:directPredict") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .toBody("*", request.toBuilder().clearEndpoint().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -249,19 +251,18 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { serializer.putPathParam(fields, "endpoint", request.getEndpoint()); return fields; }) - .setAdditionalPaths( - "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:directRawPredict") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .toBody("*", request.toBuilder().clearEndpoint().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -295,12 +296,13 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .toBody("*", request.toBuilder().clearEndpoint().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -331,12 +333,13 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearEndpoint().build(), false)) + .toBody("*", request.toBuilder().clearEndpoint().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -363,18 +366,21 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { return fields; }) .setAdditionalPaths( - "/v1/{model=projects/*/locations/*/publishers/*/models/*}:generateContent") + "/v1/{model=projects/*/locations/*/publishers/*/models/*}:generateContent", + "/v1/{model=endpoints/*}:generateContent", + "/v1/{model=publishers/*/models/*}:generateContent") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearModel().build(), false)) + .toBody("*", request.toBuilder().clearModel().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -402,18 +408,21 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { return fields; }) .setAdditionalPaths( - "/v1/{model=projects/*/locations/*/publishers/*/models/*}:streamGenerateContent") + "/v1/{model=projects/*/locations/*/publishers/*/models/*}:streamGenerateContent", + "/v1/{model=endpoints/*}:streamGenerateContent", + "/v1/{model=publishers/*/models/*}:streamGenerateContent") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearModel().build(), false)) + .toBody("*", request.toBuilder().clearModel().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -445,6 +454,7 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -479,6 +489,7 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -511,6 +522,8 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { "/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy", "/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy", "/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy", "/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy", "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy", "/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy", @@ -523,12 +536,13 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearResource().build(), false)) + .toBody("*", request.toBuilder().clearResource().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() @@ -558,6 +572,8 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { "/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy", "/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy", "/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy", "/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy", "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy", "/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy", @@ -571,6 +587,7 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -603,6 +620,8 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { "/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions", "/v1/{resource=projects/*/locations/*/models/*}:testIamPermissions", "/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions", + "/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions", "/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions", "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions", "/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions", @@ -615,6 +634,7 @@ public class HttpJsonPredictionServiceStub extends PredictionServiceStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/LlmUtilityServiceStubSettings.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/LlmUtilityServiceStubSettings.java index 3b3aa6e1ede4..46cb2bf2bcf2 100644 --- a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/LlmUtilityServiceStubSettings.java +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/LlmUtilityServiceStubSettings.java @@ -21,6 +21,7 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -238,6 +239,7 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild } /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") public static String getDefaultEndpoint() { return "aiplatform.googleapis.com:443"; } diff --git a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/PredictionServiceStubSettings.java b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/PredictionServiceStubSettings.java index 3955805e91a6..ba8c61601e43 100644 --- a/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/PredictionServiceStubSettings.java +++ b/java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/api/stub/PredictionServiceStubSettings.java @@ -22,6 +22,7 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -343,6 +344,7 @@ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuild } /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") public static String getDefaultEndpoint() { return "aiplatform.googleapis.com:443"; } diff --git a/java-vertexai/google-cloud-vertexai/src/main/resources/META-INF/native-image/com.google.cloud.vertexai.api/reflect-config.json b/java-vertexai/google-cloud-vertexai/src/main/resources/META-INF/native-image/com.google.cloud.vertexai.api/reflect-config.json index b930b65862ec..391411c26a26 100644 --- a/java-vertexai/google-cloud-vertexai/src/main/resources/META-INF/native-image/com.google.cloud.vertexai.api/reflect-config.json +++ b/java-vertexai/google-cloud-vertexai/src/main/resources/META-INF/native-image/com.google.cloud.vertexai.api/reflect-config.json @@ -323,6 +323,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.api.ResourceDescriptor", "queryAllDeclaredConstructors": true, @@ -1808,6 +1826,69 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.vertexai.api.GenerationConfig$RoutingConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerationConfig$RoutingConfig$AutoRoutingMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerationConfig$RoutingConfig$AutoRoutingMode$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerationConfig$RoutingConfig$AutoRoutingMode$ModelRoutingPreference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerationConfig$RoutingConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerationConfig$RoutingConfig$ManualRoutingMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GenerationConfig$RoutingConfig$ManualRoutingMode$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.vertexai.api.GenericOperationMetadata", "queryAllDeclaredConstructors": true, @@ -1862,6 +1943,60 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.vertexai.api.GroundingChunk", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GroundingChunk$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GroundingChunk$RetrievedContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GroundingChunk$RetrievedContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GroundingChunk$Web", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GroundingChunk$Web$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.vertexai.api.GroundingMetadata", "queryAllDeclaredConstructors": true, @@ -1880,6 +2015,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.vertexai.api.GroundingSupport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.GroundingSupport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.vertexai.api.HarmCategory", "queryAllDeclaredConstructors": true, @@ -2285,6 +2438,33 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.vertexai.api.ReservationAffinity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ReservationAffinity$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.ReservationAffinity$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.vertexai.api.ResourcesConsumed", "queryAllDeclaredConstructors": true, @@ -2447,6 +2627,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.vertexai.api.Segment", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.vertexai.api.Segment$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.vertexai.api.ShieldedVmConfig", "queryAllDeclaredConstructors": true, diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientHttpJsonTest.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientHttpJsonTest.java index d1417db82980..99c64b8f2512 100644 --- a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientHttpJsonTest.java +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientHttpJsonTest.java @@ -120,6 +120,10 @@ public void createEndpointTest() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -188,6 +192,10 @@ public void createEndpointTest2() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -256,6 +264,10 @@ public void createEndpointTest3() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -326,6 +338,10 @@ public void createEndpointTest4() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -396,6 +412,10 @@ public void getEndpointTest() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); mockService.addResponse(expectedResponse); @@ -459,6 +479,10 @@ public void getEndpointTest2() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); mockService.addResponse(expectedResponse); @@ -620,6 +644,10 @@ public void updateEndpointTest() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); mockService.addResponse(expectedResponse); @@ -643,6 +671,10 @@ public void updateEndpointTest() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -693,6 +725,10 @@ public void updateEndpointExceptionTest() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateEndpoint(endpoint, updateMask); diff --git a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientTest.java b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientTest.java index 64cf33af311f..00ffcda6d168 100644 --- a/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientTest.java +++ b/java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/api/EndpointServiceClientTest.java @@ -129,6 +129,10 @@ public void createEndpointTest() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -195,6 +199,10 @@ public void createEndpointTest2() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -261,6 +269,10 @@ public void createEndpointTest3() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -330,6 +342,10 @@ public void createEndpointTest4() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -399,6 +415,10 @@ public void getEndpointTest() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); mockEndpointService.addResponse(expectedResponse); @@ -456,6 +476,10 @@ public void getEndpointTest2() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); mockEndpointService.addResponse(expectedResponse); @@ -599,6 +623,10 @@ public void updateEndpointTest() throws Exception { .setModelDeploymentMonitoringJob("modelDeploymentMonitoringJob-1178077657") .setPredictRequestResponseLoggingConfig( PredictRequestResponseLoggingConfig.newBuilder().build()) + .setDedicatedEndpointEnabled(true) + .setDedicatedEndpointDns("dedicatedEndpointDns1492154853") + .setSatisfiesPzs(true) + .setSatisfiesPzi(true) .build(); mockEndpointService.addResponse(expectedResponse); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/AcceleratorType.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/AcceleratorType.java index 78b9a728fbb5..25642afa0c1a 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/AcceleratorType.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/AcceleratorType.java @@ -43,11 +43,13 @@ public enum AcceleratorType implements com.google.protobuf.ProtocolMessageEnum { * * *

-   * Nvidia Tesla K80 GPU.
+   * Deprecated: Nvidia Tesla K80 GPU has reached end of support,
+   * see https://cloud.google.com/compute/docs/eol/k80-eol.
    * 
* - * NVIDIA_TESLA_K80 = 1; + * NVIDIA_TESLA_K80 = 1 [deprecated = true]; */ + @java.lang.Deprecated NVIDIA_TESLA_K80(1), /** * @@ -186,12 +188,13 @@ public enum AcceleratorType implements com.google.protobuf.ProtocolMessageEnum { * * *
-   * Nvidia Tesla K80 GPU.
+   * Deprecated: Nvidia Tesla K80 GPU has reached end of support,
+   * see https://cloud.google.com/compute/docs/eol/k80-eol.
    * 
* - * NVIDIA_TESLA_K80 = 1; + * NVIDIA_TESLA_K80 = 1 [deprecated = true]; */ - public static final int NVIDIA_TESLA_K80_VALUE = 1; + @java.lang.Deprecated public static final int NVIDIA_TESLA_K80_VALUE = 1; /** * * diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/AcceleratorTypeProto.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/AcceleratorTypeProto.java index 511fe8170881..7fc2ab05f65b 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/AcceleratorTypeProto.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/AcceleratorTypeProto.java @@ -37,21 +37,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n/google/cloud/vertexai/v1/accelerator_t" - + "ype.proto\022\030google.cloud.vertexai.v1*\257\002\n\017" + + "ype.proto\022\030google.cloud.vertexai.v1*\263\002\n\017" + "AcceleratorType\022 \n\034ACCELERATOR_TYPE_UNSP" - + "ECIFIED\020\000\022\024\n\020NVIDIA_TESLA_K80\020\001\022\025\n\021NVIDI" - + "A_TESLA_P100\020\002\022\025\n\021NVIDIA_TESLA_V100\020\003\022\023\n" - + "\017NVIDIA_TESLA_P4\020\004\022\023\n\017NVIDIA_TESLA_T4\020\005\022" - + "\025\n\021NVIDIA_TESLA_A100\020\010\022\024\n\020NVIDIA_A100_80" - + "GB\020\t\022\r\n\tNVIDIA_L4\020\013\022\024\n\020NVIDIA_H100_80GB\020" - + "\r\022\n\n\006TPU_V2\020\006\022\n\n\006TPU_V3\020\007\022\016\n\nTPU_V4_POD\020" - + "\n\022\022\n\016TPU_V5_LITEPOD\020\014B\321\001\n\035com.google.clo" - + "ud.vertexai.apiB\024AcceleratorTypeProtoP\001Z" - + ">cloud.google.com/go/aiplatform/apiv1/ai" - + "platformpb;aiplatformpb\252\002\032Google.Cloud.A" - + "IPlatform.V1\312\002\032Google\\Cloud\\AIPlatform\\V" - + "1\352\002\035Google::Cloud::AIPlatform::V1b\006proto" - + "3" + + "ECIFIED\020\000\022\030\n\020NVIDIA_TESLA_K80\020\001\032\002\010\001\022\025\n\021N" + + "VIDIA_TESLA_P100\020\002\022\025\n\021NVIDIA_TESLA_V100\020" + + "\003\022\023\n\017NVIDIA_TESLA_P4\020\004\022\023\n\017NVIDIA_TESLA_T" + + "4\020\005\022\025\n\021NVIDIA_TESLA_A100\020\010\022\024\n\020NVIDIA_A10" + + "0_80GB\020\t\022\r\n\tNVIDIA_L4\020\013\022\024\n\020NVIDIA_H100_8" + + "0GB\020\r\022\n\n\006TPU_V2\020\006\022\n\n\006TPU_V3\020\007\022\016\n\nTPU_V4_" + + "POD\020\n\022\022\n\016TPU_V5_LITEPOD\020\014B\321\001\n\035com.google" + + ".cloud.vertexai.apiB\024AcceleratorTypeProt" + + "oP\001Z>cloud.google.com/go/aiplatform/apiv" + + "1/aiplatformpb;aiplatformpb\252\002\032Google.Clo" + + "ud.AIPlatform.V1\312\002\032Google\\Cloud\\AIPlatfo" + + "rm\\V1\352\002\035Google::Cloud::AIPlatform::V1b\006p" + + "roto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Candidate.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Candidate.java index d0f4d5048a56..decf263dc204 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Candidate.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Candidate.java @@ -90,7 +90,8 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Natural stop point of the model or provided stop sequence.
+     * Token generation reached a natural stopping point or a configured stop
+     * sequence.
      * 
* * STOP = 1; @@ -100,7 +101,7 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The maximum number of tokens as specified in the request was reached.
+     * Token generation reached the configured maximum output tokens.
      * 
* * MAX_TOKENS = 2; @@ -110,9 +111,10 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The token generation was stopped as the response was flagged for safety
-     * reasons. NOTE: When streaming the Candidate.content will be empty if
-     * content filters blocked the output.
+     * Token generation stopped because the content potentially contains safety
+     * violations. NOTE: When streaming,
+     * [content][google.cloud.aiplatform.v1.Candidate.content] is empty if
+     * content filters blocks the output.
      * 
* * SAFETY = 3; @@ -122,8 +124,8 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The token generation was stopped as the response was flagged for
-     * unauthorized citations.
+     * Token generation stopped because the content potentially contains
+     * copyright violations.
      * 
* * RECITATION = 4; @@ -133,7 +135,7 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * All other reasons that stopped the token generation
+     * All other reasons that stopped the token generation.
      * 
* * OTHER = 5; @@ -143,8 +145,7 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The token generation was stopped as the response was flagged for the
-     * terms which are included from the terminology blocklist.
+     * Token generation stopped because the content contains forbidden terms.
      * 
* * BLOCKLIST = 6; @@ -154,8 +155,7 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The token generation was stopped as the response was flagged for
-     * the prohibited contents.
+     * Token generation stopped for potentially containing prohibited content.
      * 
* * PROHIBITED_CONTENT = 7; @@ -165,13 +165,23 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The token generation was stopped as the response was flagged for
-     * Sensitive Personally Identifiable Information (SPII) contents.
+     * Token generation stopped because the content potentially contains
+     * Sensitive Personally Identifiable Information (SPII).
      * 
* * SPII = 8; */ SPII(8), + /** + * + * + *
+     * The function call generated by the model is invalid.
+     * 
+ * + * MALFORMED_FUNCTION_CALL = 9; + */ + MALFORMED_FUNCTION_CALL(9), UNRECOGNIZED(-1), ; @@ -189,7 +199,8 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Natural stop point of the model or provided stop sequence.
+     * Token generation reached a natural stopping point or a configured stop
+     * sequence.
      * 
* * STOP = 1; @@ -199,7 +210,7 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The maximum number of tokens as specified in the request was reached.
+     * Token generation reached the configured maximum output tokens.
      * 
* * MAX_TOKENS = 2; @@ -209,9 +220,10 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The token generation was stopped as the response was flagged for safety
-     * reasons. NOTE: When streaming the Candidate.content will be empty if
-     * content filters blocked the output.
+     * Token generation stopped because the content potentially contains safety
+     * violations. NOTE: When streaming,
+     * [content][google.cloud.aiplatform.v1.Candidate.content] is empty if
+     * content filters blocks the output.
      * 
* * SAFETY = 3; @@ -221,8 +233,8 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The token generation was stopped as the response was flagged for
-     * unauthorized citations.
+     * Token generation stopped because the content potentially contains
+     * copyright violations.
      * 
* * RECITATION = 4; @@ -232,7 +244,7 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * All other reasons that stopped the token generation
+     * All other reasons that stopped the token generation.
      * 
* * OTHER = 5; @@ -242,8 +254,7 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The token generation was stopped as the response was flagged for the
-     * terms which are included from the terminology blocklist.
+     * Token generation stopped because the content contains forbidden terms.
      * 
* * BLOCKLIST = 6; @@ -253,8 +264,7 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The token generation was stopped as the response was flagged for
-     * the prohibited contents.
+     * Token generation stopped for potentially containing prohibited content.
      * 
* * PROHIBITED_CONTENT = 7; @@ -264,13 +274,23 @@ public enum FinishReason implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * The token generation was stopped as the response was flagged for
-     * Sensitive Personally Identifiable Information (SPII) contents.
+     * Token generation stopped because the content potentially contains
+     * Sensitive Personally Identifiable Information (SPII).
      * 
* * SPII = 8; */ public static final int SPII_VALUE = 8; + /** + * + * + *
+     * The function call generated by the model is invalid.
+     * 
+ * + * MALFORMED_FUNCTION_CALL = 9; + */ + public static final int MALFORMED_FUNCTION_CALL_VALUE = 9; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -314,6 +334,8 @@ public static FinishReason forNumber(int value) { return PROHIBITED_CONTENT; case 8: return SPII; + case 9: + return MALFORMED_FUNCTION_CALL; default: return null; } @@ -438,6 +460,42 @@ public com.google.cloud.vertexai.api.ContentOrBuilder getContentOrBuilder() { return content_ == null ? com.google.cloud.vertexai.api.Content.getDefaultInstance() : content_; } + public static final int SCORE_FIELD_NUMBER = 8; + private double score_ = 0D; + /** + * + * + *
+   * Output only. Confidence score of the candidate.
+   * 
+ * + * double score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The score. + */ + @java.lang.Override + public double getScore() { + return score_; + } + + public static final int AVG_LOGPROBS_FIELD_NUMBER = 9; + private double avgLogprobs_ = 0D; + /** + * + * + *
+   * Output only. Average log probability score of the candidate.
+   * 
+ * + * double avg_logprobs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The avgLogprobs. + */ + @java.lang.Override + public double getAvgLogprobs() { + return avgLogprobs_; + } + public static final int FINISH_REASON_FIELD_NUMBER = 3; private int finishReason_ = 0; /** @@ -790,6 +848,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(7, getGroundingMetadata()); } + if (java.lang.Double.doubleToRawLongBits(score_) != 0) { + output.writeDouble(8, score_); + } + if (java.lang.Double.doubleToRawLongBits(avgLogprobs_) != 0) { + output.writeDouble(9, avgLogprobs_); + } getUnknownFields().writeTo(output); } @@ -822,6 +886,12 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getGroundingMetadata()); } + if (java.lang.Double.doubleToRawLongBits(score_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(8, score_); + } + if (java.lang.Double.doubleToRawLongBits(avgLogprobs_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(9, avgLogprobs_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -842,6 +912,10 @@ public boolean equals(final java.lang.Object obj) { if (hasContent()) { if (!getContent().equals(other.getContent())) return false; } + if (java.lang.Double.doubleToLongBits(getScore()) + != java.lang.Double.doubleToLongBits(other.getScore())) return false; + if (java.lang.Double.doubleToLongBits(getAvgLogprobs()) + != java.lang.Double.doubleToLongBits(other.getAvgLogprobs())) return false; if (finishReason_ != other.finishReason_) return false; if (!getSafetyRatingsList().equals(other.getSafetyRatingsList())) return false; if (hasFinishMessage() != other.hasFinishMessage()) return false; @@ -873,6 +947,15 @@ public int hashCode() { hash = (37 * hash) + CONTENT_FIELD_NUMBER; hash = (53 * hash) + getContent().hashCode(); } + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getScore())); + hash = (37 * hash) + AVG_LOGPROBS_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getAvgLogprobs())); hash = (37 * hash) + FINISH_REASON_FIELD_NUMBER; hash = (53 * hash) + finishReason_; if (getSafetyRatingsCount() > 0) { @@ -1048,6 +1131,8 @@ public Builder clear() { contentBuilder_.dispose(); contentBuilder_ = null; } + score_ = 0D; + avgLogprobs_ = 0D; finishReason_ = 0; if (safetyRatingsBuilder_ == null) { safetyRatings_ = java.util.Collections.emptyList(); @@ -1055,7 +1140,7 @@ public Builder clear() { safetyRatings_ = null; safetyRatingsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000020); finishMessage_ = ""; citationMetadata_ = null; if (citationMetadataBuilder_ != null) { @@ -1104,9 +1189,9 @@ public com.google.cloud.vertexai.api.Candidate buildPartial() { private void buildPartialRepeatedFields(com.google.cloud.vertexai.api.Candidate result) { if (safetyRatingsBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { + if (((bitField0_ & 0x00000020) != 0)) { safetyRatings_ = java.util.Collections.unmodifiableList(safetyRatings_); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000020); } result.safetyRatings_ = safetyRatings_; } else { @@ -1125,18 +1210,24 @@ private void buildPartial0(com.google.cloud.vertexai.api.Candidate result) { to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000004) != 0)) { - result.finishReason_ = finishReason_; + result.score_ = score_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.avgLogprobs_ = avgLogprobs_; } if (((from_bitField0_ & 0x00000010) != 0)) { + result.finishReason_ = finishReason_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { result.finishMessage_ = finishMessage_; to_bitField0_ |= 0x00000002; } - if (((from_bitField0_ & 0x00000020) != 0)) { + if (((from_bitField0_ & 0x00000080) != 0)) { result.citationMetadata_ = citationMetadataBuilder_ == null ? citationMetadata_ : citationMetadataBuilder_.build(); to_bitField0_ |= 0x00000004; } - if (((from_bitField0_ & 0x00000040) != 0)) { + if (((from_bitField0_ & 0x00000100) != 0)) { result.groundingMetadata_ = groundingMetadataBuilder_ == null ? groundingMetadata_ @@ -1197,6 +1288,12 @@ public Builder mergeFrom(com.google.cloud.vertexai.api.Candidate other) { if (other.hasContent()) { mergeContent(other.getContent()); } + if (other.getScore() != 0D) { + setScore(other.getScore()); + } + if (other.getAvgLogprobs() != 0D) { + setAvgLogprobs(other.getAvgLogprobs()); + } if (other.finishReason_ != 0) { setFinishReasonValue(other.getFinishReasonValue()); } @@ -1204,7 +1301,7 @@ public Builder mergeFrom(com.google.cloud.vertexai.api.Candidate other) { if (!other.safetyRatings_.isEmpty()) { if (safetyRatings_.isEmpty()) { safetyRatings_ = other.safetyRatings_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000020); } else { ensureSafetyRatingsIsMutable(); safetyRatings_.addAll(other.safetyRatings_); @@ -1217,7 +1314,7 @@ public Builder mergeFrom(com.google.cloud.vertexai.api.Candidate other) { safetyRatingsBuilder_.dispose(); safetyRatingsBuilder_ = null; safetyRatings_ = other.safetyRatings_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000020); safetyRatingsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getSafetyRatingsFieldBuilder() @@ -1229,7 +1326,7 @@ public Builder mergeFrom(com.google.cloud.vertexai.api.Candidate other) { } if (other.hasFinishMessage()) { finishMessage_ = other.finishMessage_; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000040; onChanged(); } if (other.hasCitationMetadata()) { @@ -1279,7 +1376,7 @@ public Builder mergeFrom( case 24: { finishReason_ = input.readEnum(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000010; break; } // case 24 case 34: @@ -1298,23 +1395,35 @@ public Builder mergeFrom( case 42: { finishMessage_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000040; break; } // case 42 case 50: { input.readMessage( getCitationMetadataFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000080; break; } // case 50 case 58: { input.readMessage( getGroundingMetadataFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000100; break; } // case 58 + case 65: + { + score_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 65 + case 73: + { + avgLogprobs_ = input.readDouble(); + bitField0_ |= 0x00000008; + break; + } // case 73 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1590,6 +1699,112 @@ public com.google.cloud.vertexai.api.ContentOrBuilder getContentOrBuilder() { return contentBuilder_; } + private double score_; + /** + * + * + *
+     * Output only. Confidence score of the candidate.
+     * 
+ * + * double score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The score. + */ + @java.lang.Override + public double getScore() { + return score_; + } + /** + * + * + *
+     * Output only. Confidence score of the candidate.
+     * 
+ * + * double score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The score to set. + * @return This builder for chaining. + */ + public Builder setScore(double value) { + + score_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Confidence score of the candidate.
+     * 
+ * + * double score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearScore() { + bitField0_ = (bitField0_ & ~0x00000004); + score_ = 0D; + onChanged(); + return this; + } + + private double avgLogprobs_; + /** + * + * + *
+     * Output only. Average log probability score of the candidate.
+     * 
+ * + * double avg_logprobs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The avgLogprobs. + */ + @java.lang.Override + public double getAvgLogprobs() { + return avgLogprobs_; + } + /** + * + * + *
+     * Output only. Average log probability score of the candidate.
+     * 
+ * + * double avg_logprobs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The avgLogprobs to set. + * @return This builder for chaining. + */ + public Builder setAvgLogprobs(double value) { + + avgLogprobs_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Average log probability score of the candidate.
+     * 
+ * + * double avg_logprobs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAvgLogprobs() { + bitField0_ = (bitField0_ & ~0x00000008); + avgLogprobs_ = 0D; + onChanged(); + return this; + } + private int finishReason_ = 0; /** * @@ -1626,7 +1841,7 @@ public int getFinishReasonValue() { */ public Builder setFinishReasonValue(int value) { finishReason_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1671,7 +1886,7 @@ public Builder setFinishReason(com.google.cloud.vertexai.api.Candidate.FinishRea if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000010; finishReason_ = value.getNumber(); onChanged(); return this; @@ -1691,7 +1906,7 @@ public Builder setFinishReason(com.google.cloud.vertexai.api.Candidate.FinishRea * @return This builder for chaining. */ public Builder clearFinishReason() { - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000010); finishReason_ = 0; onChanged(); return this; @@ -1701,10 +1916,10 @@ public Builder clearFinishReason() { java.util.Collections.emptyList(); private void ensureSafetyRatingsIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { + if (!((bitField0_ & 0x00000020) != 0)) { safetyRatings_ = new java.util.ArrayList(safetyRatings_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000020; } } @@ -1964,7 +2179,7 @@ public Builder addAllSafetyRatings( public Builder clearSafetyRatings() { if (safetyRatingsBuilder_ == null) { safetyRatings_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); } else { safetyRatingsBuilder_.clear(); @@ -2116,7 +2331,7 @@ public com.google.cloud.vertexai.api.SafetyRating.Builder addSafetyRatingsBuilde com.google.cloud.vertexai.api.SafetyRating.Builder, com.google.cloud.vertexai.api.SafetyRatingOrBuilder>( safetyRatings_, - ((bitField0_ & 0x00000008) != 0), + ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); safetyRatings_ = null; @@ -2138,7 +2353,7 @@ public com.google.cloud.vertexai.api.SafetyRating.Builder addSafetyRatingsBuilde * @return Whether the finishMessage field is set. */ public boolean hasFinishMessage() { - return ((bitField0_ & 0x00000010) != 0); + return ((bitField0_ & 0x00000040) != 0); } /** * @@ -2204,7 +2419,7 @@ public Builder setFinishMessage(java.lang.String value) { throw new NullPointerException(); } finishMessage_ = value; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -2222,7 +2437,7 @@ public Builder setFinishMessage(java.lang.String value) { */ public Builder clearFinishMessage() { finishMessage_ = getDefaultInstance().getFinishMessage(); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } @@ -2245,7 +2460,7 @@ public Builder setFinishMessageBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); finishMessage_ = value; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -2270,7 +2485,7 @@ public Builder setFinishMessageBytes(com.google.protobuf.ByteString value) { * @return Whether the citationMetadata field is set. */ public boolean hasCitationMetadata() { - return ((bitField0_ & 0x00000020) != 0); + return ((bitField0_ & 0x00000080) != 0); } /** * @@ -2314,7 +2529,7 @@ public Builder setCitationMetadata(com.google.cloud.vertexai.api.CitationMetadat } else { citationMetadataBuilder_.setMessage(value); } - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2336,7 +2551,7 @@ public Builder setCitationMetadata( } else { citationMetadataBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2353,7 +2568,7 @@ public Builder setCitationMetadata( */ public Builder mergeCitationMetadata(com.google.cloud.vertexai.api.CitationMetadata value) { if (citationMetadataBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0) + if (((bitField0_ & 0x00000080) != 0) && citationMetadata_ != null && citationMetadata_ != com.google.cloud.vertexai.api.CitationMetadata.getDefaultInstance()) { @@ -2365,7 +2580,7 @@ public Builder mergeCitationMetadata(com.google.cloud.vertexai.api.CitationMetad citationMetadataBuilder_.mergeFrom(value); } if (citationMetadata_ != null) { - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000080; onChanged(); } return this; @@ -2382,7 +2597,7 @@ public Builder mergeCitationMetadata(com.google.cloud.vertexai.api.CitationMetad * */ public Builder clearCitationMetadata() { - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000080); citationMetadata_ = null; if (citationMetadataBuilder_ != null) { citationMetadataBuilder_.dispose(); @@ -2403,7 +2618,7 @@ public Builder clearCitationMetadata() { * */ public com.google.cloud.vertexai.api.CitationMetadata.Builder getCitationMetadataBuilder() { - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000080; onChanged(); return getCitationMetadataFieldBuilder().getBuilder(); } @@ -2475,7 +2690,7 @@ public com.google.cloud.vertexai.api.CitationMetadataOrBuilder getCitationMetada * @return Whether the groundingMetadata field is set. */ public boolean hasGroundingMetadata() { - return ((bitField0_ & 0x00000040) != 0); + return ((bitField0_ & 0x00000100) != 0); } /** * @@ -2519,7 +2734,7 @@ public Builder setGroundingMetadata(com.google.cloud.vertexai.api.GroundingMetad } else { groundingMetadataBuilder_.setMessage(value); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000100; onChanged(); return this; } @@ -2541,7 +2756,7 @@ public Builder setGroundingMetadata( } else { groundingMetadataBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000100; onChanged(); return this; } @@ -2558,7 +2773,7 @@ public Builder setGroundingMetadata( */ public Builder mergeGroundingMetadata(com.google.cloud.vertexai.api.GroundingMetadata value) { if (groundingMetadataBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0) + if (((bitField0_ & 0x00000100) != 0) && groundingMetadata_ != null && groundingMetadata_ != com.google.cloud.vertexai.api.GroundingMetadata.getDefaultInstance()) { @@ -2570,7 +2785,7 @@ public Builder mergeGroundingMetadata(com.google.cloud.vertexai.api.GroundingMet groundingMetadataBuilder_.mergeFrom(value); } if (groundingMetadata_ != null) { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000100; onChanged(); } return this; @@ -2587,7 +2802,7 @@ public Builder mergeGroundingMetadata(com.google.cloud.vertexai.api.GroundingMet * */ public Builder clearGroundingMetadata() { - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000100); groundingMetadata_ = null; if (groundingMetadataBuilder_ != null) { groundingMetadataBuilder_.dispose(); @@ -2608,7 +2823,7 @@ public Builder clearGroundingMetadata() { * */ public com.google.cloud.vertexai.api.GroundingMetadata.Builder getGroundingMetadataBuilder() { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000100; onChanged(); return getGroundingMetadataFieldBuilder().getBuilder(); } diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/CandidateOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/CandidateOrBuilder.java index dfd763ad4091..1e81e9485984 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/CandidateOrBuilder.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/CandidateOrBuilder.java @@ -78,6 +78,32 @@ public interface CandidateOrBuilder */ com.google.cloud.vertexai.api.ContentOrBuilder getContentOrBuilder(); + /** + * + * + *
+   * Output only. Confidence score of the candidate.
+   * 
+ * + * double score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The score. + */ + double getScore(); + + /** + * + * + *
+   * Output only. Average log probability score of the candidate.
+   * 
+ * + * double avg_logprobs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The avgLogprobs. + */ + double getAvgLogprobs(); + /** * * diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ComputeTokensRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ComputeTokensRequest.java index 5507cdaef9bf..57374876a6e4 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ComputeTokensRequest.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ComputeTokensRequest.java @@ -41,6 +41,8 @@ private ComputeTokensRequest(com.google.protobuf.GeneratedMessageV3.Builder b private ComputeTokensRequest() { endpoint_ = ""; instances_ = java.util.Collections.emptyList(); + model_ = ""; + contents_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -129,12 +131,12 @@ public com.google.protobuf.ByteString getEndpointBytes() { * * *
-   * Required. The instances that are the input to token computing API call.
+   * Optional. The instances that are the input to token computing API call.
    * Schema is identical to the prediction schema of the text model, even for
    * the non-text models, like chat models, or Codey models.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -145,12 +147,12 @@ public java.util.List getInstancesList() { * * *
-   * Required. The instances that are the input to token computing API call.
+   * Optional. The instances that are the input to token computing API call.
    * Schema is identical to the prediction schema of the text model, even for
    * the non-text models, like chat models, or Codey models.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -161,12 +163,12 @@ public java.util.List getInstances * * *
-   * Required. The instances that are the input to token computing API call.
+   * Optional. The instances that are the input to token computing API call.
    * Schema is identical to the prediction schema of the text model, even for
    * the non-text models, like chat models, or Codey models.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -177,12 +179,12 @@ public int getInstancesCount() { * * *
-   * Required. The instances that are the input to token computing API call.
+   * Optional. The instances that are the input to token computing API call.
    * Schema is identical to the prediction schema of the text model, even for
    * the non-text models, like chat models, or Codey models.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -193,12 +195,12 @@ public com.google.protobuf.Value getInstances(int index) { * * *
-   * Required. The instances that are the input to token computing API call.
+   * Optional. The instances that are the input to token computing API call.
    * Schema is identical to the prediction schema of the text model, even for
    * the non-text models, like chat models, or Codey models.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -206,6 +208,142 @@ public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { return instances_.get(index); } + public static final int MODEL_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object model_ = ""; + /** + * + * + *
+   * Optional. The name of the publisher model requested to serve the
+   * prediction. Format:
+   * projects/{project}/locations/{location}/publishers/*/models/*
+   * 
+ * + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The name of the publisher model requested to serve the
+   * prediction. Format:
+   * projects/{project}/locations/{location}/publishers/*/models/*
+   * 
+ * + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENTS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List contents_; + /** + * + * + *
+   * Optional. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getContentsList() { + return contents_; + } + /** + * + * + *
+   * Optional. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getContentsOrBuilderList() { + return contents_; + } + /** + * + * + *
+   * Optional. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getContentsCount() { + return contents_.size(); + } + /** + * + * + *
+   * Optional. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Content getContents(int index) { + return contents_.get(index); + } + /** + * + * + *
+   * Optional. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int index) { + return contents_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -226,6 +364,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < instances_.size(); i++) { output.writeMessage(2, instances_.get(i)); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, model_); + } + for (int i = 0; i < contents_.size(); i++) { + output.writeMessage(4, contents_.get(i)); + } getUnknownFields().writeTo(output); } @@ -241,6 +385,12 @@ public int getSerializedSize() { for (int i = 0; i < instances_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, instances_.get(i)); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, model_); + } + for (int i = 0; i < contents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, contents_.get(i)); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -259,6 +409,8 @@ public boolean equals(final java.lang.Object obj) { if (!getEndpoint().equals(other.getEndpoint())) return false; if (!getInstancesList().equals(other.getInstancesList())) return false; + if (!getModel().equals(other.getModel())) return false; + if (!getContentsList().equals(other.getContentsList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -276,6 +428,12 @@ public int hashCode() { hash = (37 * hash) + INSTANCES_FIELD_NUMBER; hash = (53 * hash) + getInstancesList().hashCode(); } + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + if (getContentsCount() > 0) { + hash = (37 * hash) + CONTENTS_FIELD_NUMBER; + hash = (53 * hash) + getContentsList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -423,6 +581,14 @@ public Builder clear() { instancesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); + model_ = ""; + if (contentsBuilder_ == null) { + contents_ = java.util.Collections.emptyList(); + } else { + contents_ = null; + contentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -469,6 +635,15 @@ private void buildPartialRepeatedFields( } else { result.instances_ = instancesBuilder_.build(); } + if (contentsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + contents_ = java.util.Collections.unmodifiableList(contents_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.contents_ = contents_; + } else { + result.contents_ = contentsBuilder_.build(); + } } private void buildPartial0(com.google.cloud.vertexai.api.ComputeTokensRequest result) { @@ -476,6 +651,9 @@ private void buildPartial0(com.google.cloud.vertexai.api.ComputeTokensRequest re if (((from_bitField0_ & 0x00000001) != 0)) { result.endpoint_ = endpoint_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.model_ = model_; + } } @java.lang.Override @@ -556,6 +734,38 @@ public Builder mergeFrom(com.google.cloud.vertexai.api.ComputeTokensRequest othe } } } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (contentsBuilder_ == null) { + if (!other.contents_.isEmpty()) { + if (contents_.isEmpty()) { + contents_ = other.contents_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureContentsIsMutable(); + contents_.addAll(other.contents_); + } + onChanged(); + } + } else { + if (!other.contents_.isEmpty()) { + if (contentsBuilder_.isEmpty()) { + contentsBuilder_.dispose(); + contentsBuilder_ = null; + contents_ = other.contents_; + bitField0_ = (bitField0_ & ~0x00000008); + contentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getContentsFieldBuilder() + : null; + } else { + contentsBuilder_.addAllMessages(other.contents_); + } + } + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -600,6 +810,25 @@ public Builder mergeFrom( } break; } // case 18 + case 26: + { + model_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.cloud.vertexai.api.Content m = + input.readMessage( + com.google.cloud.vertexai.api.Content.parser(), extensionRegistry); + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.add(m); + } else { + contentsBuilder_.addMessage(m); + } + break; + } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -760,13 +989,13 @@ private void ensureInstancesIsMutable() { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public java.util.List getInstancesList() { @@ -780,13 +1009,13 @@ public java.util.List getInstancesList() { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public int getInstancesCount() { @@ -800,13 +1029,13 @@ public int getInstancesCount() { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.protobuf.Value getInstances(int index) { @@ -820,13 +1049,13 @@ public com.google.protobuf.Value getInstances(int index) { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setInstances(int index, com.google.protobuf.Value value) { @@ -846,13 +1075,13 @@ public Builder setInstances(int index, com.google.protobuf.Value value) { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setInstances(int index, com.google.protobuf.Value.Builder builderForValue) { @@ -869,13 +1098,13 @@ public Builder setInstances(int index, com.google.protobuf.Value.Builder builder * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addInstances(com.google.protobuf.Value value) { @@ -895,13 +1124,13 @@ public Builder addInstances(com.google.protobuf.Value value) { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addInstances(int index, com.google.protobuf.Value value) { @@ -921,13 +1150,13 @@ public Builder addInstances(int index, com.google.protobuf.Value value) { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addInstances(com.google.protobuf.Value.Builder builderForValue) { @@ -944,13 +1173,13 @@ public Builder addInstances(com.google.protobuf.Value.Builder builderForValue) { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addInstances(int index, com.google.protobuf.Value.Builder builderForValue) { @@ -967,13 +1196,13 @@ public Builder addInstances(int index, com.google.protobuf.Value.Builder builder * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addAllInstances(java.lang.Iterable values) { @@ -990,13 +1219,13 @@ public Builder addAllInstances(java.lang.Iterable - * Required. The instances that are the input to token computing API call. + * Optional. The instances that are the input to token computing API call. * Schema is identical to the prediction schema of the text model, even for * the non-text models, like chat models, or Codey models. * * * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder clearInstances() { @@ -1013,13 +1242,13 @@ public Builder clearInstances() { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder removeInstances(int index) { @@ -1036,13 +1265,13 @@ public Builder removeInstances(int index) { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.protobuf.Value.Builder getInstancesBuilder(int index) { @@ -1052,13 +1281,13 @@ public com.google.protobuf.Value.Builder getInstancesBuilder(int index) { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { @@ -1072,13 +1301,13 @@ public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public java.util.List @@ -1093,13 +1322,13 @@ public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.protobuf.Value.Builder addInstancesBuilder() { @@ -1109,13 +1338,13 @@ public com.google.protobuf.Value.Builder addInstancesBuilder() { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.protobuf.Value.Builder addInstancesBuilder(int index) { @@ -1126,13 +1355,13 @@ public com.google.protobuf.Value.Builder addInstancesBuilder(int index) { * * *
-     * Required. The instances that are the input to token computing API call.
+     * Optional. The instances that are the input to token computing API call.
      * Schema is identical to the prediction schema of the text model, even for
      * the non-text models, like chat models, or Codey models.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public java.util.List getInstancesBuilderList() { @@ -1156,6 +1385,506 @@ public java.util.List getInstancesBuilderList return instancesBuilder_; } + private java.lang.Object model_ = ""; + /** + * + * + *
+     * Optional. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * projects/{project}/locations/{location}/publishers/*/models/*
+     * 
+ * + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * projects/{project}/locations/{location}/publishers/*/models/*
+     * 
+ * + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for model. + */ + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * projects/{project}/locations/{location}/publishers/*/models/*
+     * 
+ * + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + model_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * projects/{project}/locations/{location}/publishers/*/models/*
+     * 
+ * + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearModel() { + model_ = getDefaultInstance().getModel(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of the publisher model requested to serve the
+     * prediction. Format:
+     * projects/{project}/locations/{location}/publishers/*/models/*
+     * 
+ * + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + model_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List contents_ = + java.util.Collections.emptyList(); + + private void ensureContentsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + contents_ = new java.util.ArrayList(contents_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder> + contentsBuilder_; + + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getContentsList() { + if (contentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(contents_); + } else { + return contentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getContentsCount() { + if (contentsBuilder_ == null) { + return contents_.size(); + } else { + return contentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Content getContents(int index) { + if (contentsBuilder_ == null) { + return contents_.get(index); + } else { + return contentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setContents(int index, com.google.cloud.vertexai.api.Content value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.set(index, value); + onChanged(); + } else { + contentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setContents( + int index, com.google.cloud.vertexai.api.Content.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.set(index, builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addContents(com.google.cloud.vertexai.api.Content value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.add(value); + onChanged(); + } else { + contentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addContents(int index, com.google.cloud.vertexai.api.Content value) { + if (contentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentsIsMutable(); + contents_.add(index, value); + onChanged(); + } else { + contentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addContents(com.google.cloud.vertexai.api.Content.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.add(builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addContents( + int index, com.google.cloud.vertexai.api.Content.Builder builderForValue) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.add(index, builderForValue.build()); + onChanged(); + } else { + contentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllContents( + java.lang.Iterable values) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, contents_); + onChanged(); + } else { + contentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearContents() { + if (contentsBuilder_ == null) { + contents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + contentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeContents(int index) { + if (contentsBuilder_ == null) { + ensureContentsIsMutable(); + contents_.remove(index); + onChanged(); + } else { + contentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Content.Builder getContentsBuilder(int index) { + return getContentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int index) { + if (contentsBuilder_ == null) { + return contents_.get(index); + } else { + return contentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getContentsOrBuilderList() { + if (contentsBuilder_ != null) { + return contentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(contents_); + } + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Content.Builder addContentsBuilder() { + return getContentsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Content.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Content.Builder addContentsBuilder(int index) { + return getContentsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Content.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Input content.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getContentsBuilderList() { + return getContentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder> + getContentsFieldBuilder() { + if (contentsBuilder_ == null) { + contentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder>( + contents_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + contents_ = null; + } + return contentsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ComputeTokensRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ComputeTokensRequestOrBuilder.java index 9c75227b450c..88496eed85a6 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ComputeTokensRequestOrBuilder.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ComputeTokensRequestOrBuilder.java @@ -59,12 +59,12 @@ public interface ComputeTokensRequestOrBuilder * * *
-   * Required. The instances that are the input to token computing API call.
+   * Optional. The instances that are the input to token computing API call.
    * Schema is identical to the prediction schema of the text model, even for
    * the non-text models, like chat models, or Codey models.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ java.util.List getInstancesList(); @@ -72,12 +72,12 @@ public interface ComputeTokensRequestOrBuilder * * *
-   * Required. The instances that are the input to token computing API call.
+   * Optional. The instances that are the input to token computing API call.
    * Schema is identical to the prediction schema of the text model, even for
    * the non-text models, like chat models, or Codey models.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ com.google.protobuf.Value getInstances(int index); @@ -85,12 +85,12 @@ public interface ComputeTokensRequestOrBuilder * * *
-   * Required. The instances that are the input to token computing API call.
+   * Optional. The instances that are the input to token computing API call.
    * Schema is identical to the prediction schema of the text model, even for
    * the non-text models, like chat models, or Codey models.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ int getInstancesCount(); @@ -98,12 +98,12 @@ public interface ComputeTokensRequestOrBuilder * * *
-   * Required. The instances that are the input to token computing API call.
+   * Optional. The instances that are the input to token computing API call.
    * Schema is identical to the prediction schema of the text model, even for
    * the non-text models, like chat models, or Codey models.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ java.util.List getInstancesOrBuilderList(); @@ -111,13 +111,104 @@ public interface ComputeTokensRequestOrBuilder * * *
-   * Required. The instances that are the input to token computing API call.
+   * Optional. The instances that are the input to token computing API call.
    * Schema is identical to the prediction schema of the text model, even for
    * the non-text models, like chat models, or Codey models.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index); + + /** + * + * + *
+   * Optional. The name of the publisher model requested to serve the
+   * prediction. Format:
+   * projects/{project}/locations/{location}/publishers/*/models/*
+   * 
+ * + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The model. + */ + java.lang.String getModel(); + /** + * + * + *
+   * Optional. The name of the publisher model requested to serve the
+   * prediction. Format:
+   * projects/{project}/locations/{location}/publishers/*/models/*
+   * 
+ * + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for model. + */ + com.google.protobuf.ByteString getModelBytes(); + + /** + * + * + *
+   * Optional. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getContentsList(); + /** + * + * + *
+   * Optional. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.Content getContents(int index); + /** + * + * + *
+   * Optional. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getContentsCount(); + /** + * + * + *
+   * Optional. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getContentsOrBuilderList(); + /** + * + * + *
+   * Optional. Input content.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int index); } diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ContentProto.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ContentProto.java index 3c0480e311bd..36b84a0e1ebc 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ContentProto.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ContentProto.java @@ -52,6 +52,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_vertexai_v1_GenerationConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_vertexai_v1_GenerationConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_AutoRoutingMode_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_AutoRoutingMode_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_ManualRoutingMode_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_ManualRoutingMode_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_vertexai_v1_SafetySetting_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -72,6 +84,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_vertexai_v1_Candidate_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_vertexai_v1_Candidate_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1_Segment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1_Segment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1_GroundingChunk_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1_GroundingChunk_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1_GroundingChunk_Web_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1_GroundingChunk_Web_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1_GroundingChunk_RetrievedContext_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1_GroundingChunk_RetrievedContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1_GroundingSupport_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1_GroundingSupport_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_vertexai_v1_GroundingMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -112,83 +144,122 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "e_uri\030\002 \001(\tB\003\340A\002\"y\n\rVideoMetadata\0224\n\014sta" + "rt_offset\030\001 \001(\0132\031.google.protobuf.Durati" + "onB\003\340A\001\0222\n\nend_offset\030\002 \001(\0132\031.google.pro" - + "tobuf.DurationB\003\340A\001\"\204\004\n\020GenerationConfig" + + "tobuf.DurationB\003\340A\001\"\323\t\n\020GenerationConfig" + "\022\035\n\013temperature\030\001 \001(\002B\003\340A\001H\000\210\001\001\022\027\n\005top_p" + "\030\002 \001(\002B\003\340A\001H\001\210\001\001\022\027\n\005top_k\030\003 \001(\002B\003\340A\001H\002\210\001" + "\001\022!\n\017candidate_count\030\004 \001(\005B\003\340A\001H\003\210\001\001\022#\n\021" + "max_output_tokens\030\005 \001(\005B\003\340A\001H\004\210\001\001\022\033\n\016sto" + "p_sequences\030\006 \003(\tB\003\340A\001\022\"\n\020presence_penal" + "ty\030\010 \001(\002B\003\340A\001H\005\210\001\001\022#\n\021frequency_penalty\030" - + "\t \001(\002B\003\340A\001H\006\210\001\001\022\037\n\022response_mime_type\030\r " - + "\001(\tB\003\340A\001\022C\n\017response_schema\030\020 \001(\0132 .goog" - + "le.cloud.vertexai.v1.SchemaB\003\340A\001H\007\210\001\001B\016\n" - + "\014_temperatureB\010\n\006_top_pB\010\n\006_top_kB\022\n\020_ca" - + "ndidate_countB\024\n\022_max_output_tokensB\023\n\021_" - + "presence_penaltyB\024\n\022_frequency_penaltyB\022" - + "\n\020_response_schema\"\334\003\n\rSafetySetting\022=\n\010" - + "category\030\001 \001(\0162&.google.cloud.vertexai.v" - + "1.HarmCategoryB\003\340A\002\022R\n\tthreshold\030\002 \001(\0162:" + + "\t \001(\002B\003\340A\001H\006\210\001\001\022\026\n\004seed\030\014 \001(\005B\003\340A\001H\007\210\001\001\022" + + "\037\n\022response_mime_type\030\r \001(\tB\003\340A\001\022C\n\017resp" + + "onse_schema\030\020 \001(\0132 .google.cloud.vertexa" + + "i.v1.SchemaB\003\340A\001H\010\210\001\001\022Z\n\016routing_config\030" + + "\021 \001(\01328.google.cloud.vertexai.v1.Generat" + + "ionConfig.RoutingConfigB\003\340A\001H\t\210\001\001\032\274\004\n\rRo" + + "utingConfig\022]\n\tauto_mode\030\001 \001(\0132H.google." + + "cloud.vertexai.v1.GenerationConfig.Routi" + + "ngConfig.AutoRoutingModeH\000\022a\n\013manual_mod" + + "e\030\002 \001(\0132J.google.cloud.vertexai.v1.Gener" + + "ationConfig.RoutingConfig.ManualRoutingM" + + "odeH\000\032\231\002\n\017AutoRoutingMode\022\206\001\n\030model_rout" + + "ing_preference\030\001 \001(\0162_.google.cloud.vert" + + "exai.v1.GenerationConfig.RoutingConfig.A" + + "utoRoutingMode.ModelRoutingPreferenceH\000\210" + + "\001\001\"`\n\026ModelRoutingPreference\022\013\n\007UNKNOWN\020" + + "\000\022\026\n\022PRIORITIZE_QUALITY\020\001\022\014\n\010BALANCED\020\002\022" + + "\023\n\017PRIORITIZE_COST\020\003B\033\n\031_model_routing_p" + + "reference\032;\n\021ManualRoutingMode\022\027\n\nmodel_" + + "name\030\001 \001(\tH\000\210\001\001B\r\n\013_model_nameB\020\n\016routin" + + "g_configB\016\n\014_temperatureB\010\n\006_top_pB\010\n\006_t" + + "op_kB\022\n\020_candidate_countB\024\n\022_max_output_" + + "tokensB\023\n\021_presence_penaltyB\024\n\022_frequenc" + + "y_penaltyB\007\n\005_seedB\022\n\020_response_schemaB\021" + + "\n\017_routing_config\"\345\003\n\rSafetySetting\022=\n\010c" + + "ategory\030\001 \001(\0162&.google.cloud.vertexai.v1" + + ".HarmCategoryB\003\340A\002\022R\n\tthreshold\030\002 \001(\0162:." + + "google.cloud.vertexai.v1.SafetySetting.H" + + "armBlockThresholdB\003\340A\002\022L\n\006method\030\004 \001(\01627" + ".google.cloud.vertexai.v1.SafetySetting." - + "HarmBlockThresholdB\003\340A\002\022L\n\006method\030\004 \001(\0162" - + "7.google.cloud.vertexai.v1.SafetySetting" - + ".HarmBlockMethodB\003\340A\001\"\224\001\n\022HarmBlockThres" - + "hold\022$\n HARM_BLOCK_THRESHOLD_UNSPECIFIED" - + "\020\000\022\027\n\023BLOCK_LOW_AND_ABOVE\020\001\022\032\n\026BLOCK_MED" - + "IUM_AND_ABOVE\020\002\022\023\n\017BLOCK_ONLY_HIGH\020\003\022\016\n\n" - + "BLOCK_NONE\020\004\"S\n\017HarmBlockMethod\022!\n\035HARM_" - + "BLOCK_METHOD_UNSPECIFIED\020\000\022\014\n\010SEVERITY\020\001" - + "\022\017\n\013PROBABILITY\020\002\"\271\004\n\014SafetyRating\022=\n\010ca" - + "tegory\030\001 \001(\0162&.google.cloud.vertexai.v1." - + "HarmCategoryB\003\340A\003\022P\n\013probability\030\002 \001(\01626" - + ".google.cloud.vertexai.v1.SafetyRating.H" - + "armProbabilityB\003\340A\003\022\036\n\021probability_score" - + "\030\005 \001(\002B\003\340A\003\022J\n\010severity\030\006 \001(\01623.google.c" - + "loud.vertexai.v1.SafetyRating.HarmSeveri" - + "tyB\003\340A\003\022\033\n\016severity_score\030\007 \001(\002B\003\340A\003\022\024\n\007" - + "blocked\030\003 \001(\010B\003\340A\003\"b\n\017HarmProbability\022 \n" - + "\034HARM_PROBABILITY_UNSPECIFIED\020\000\022\016\n\nNEGLI" - + "GIBLE\020\001\022\007\n\003LOW\020\002\022\n\n\006MEDIUM\020\003\022\010\n\004HIGH\020\004\"\224" - + "\001\n\014HarmSeverity\022\035\n\031HARM_SEVERITY_UNSPECI" - + "FIED\020\000\022\034\n\030HARM_SEVERITY_NEGLIGIBLE\020\001\022\025\n\021" - + "HARM_SEVERITY_LOW\020\002\022\030\n\024HARM_SEVERITY_MED" - + "IUM\020\003\022\026\n\022HARM_SEVERITY_HIGH\020\004\"N\n\020Citatio" - + "nMetadata\022:\n\tcitations\030\001 \003(\0132\".google.cl" - + "oud.vertexai.v1.CitationB\003\340A\003\"\252\001\n\010Citati" - + "on\022\030\n\013start_index\030\001 \001(\005B\003\340A\003\022\026\n\tend_inde" - + "x\030\002 \001(\005B\003\340A\003\022\020\n\003uri\030\003 \001(\tB\003\340A\003\022\022\n\005title\030" - + "\004 \001(\tB\003\340A\003\022\024\n\007license\030\005 \001(\tB\003\340A\003\0220\n\020publ" - + "ication_date\030\006 \001(\0132\021.google.type.DateB\003\340" - + "A\003\"\334\004\n\tCandidate\022\022\n\005index\030\001 \001(\005B\003\340A\003\0227\n\007" - + "content\030\002 \001(\0132!.google.cloud.vertexai.v1" - + ".ContentB\003\340A\003\022L\n\rfinish_reason\030\003 \001(\01620.g" - + "oogle.cloud.vertexai.v1.Candidate.Finish" - + "ReasonB\003\340A\003\022C\n\016safety_ratings\030\004 \003(\0132&.go" - + "ogle.cloud.vertexai.v1.SafetyRatingB\003\340A\003" - + "\022 \n\016finish_message\030\005 \001(\tB\003\340A\003H\000\210\001\001\022J\n\021ci" - + "tation_metadata\030\006 \001(\0132*.google.cloud.ver" - + "texai.v1.CitationMetadataB\003\340A\003\022L\n\022ground" - + "ing_metadata\030\007 \001(\0132+.google.cloud.vertex" - + "ai.v1.GroundingMetadataB\003\340A\003\"\237\001\n\014FinishR" - + "eason\022\035\n\031FINISH_REASON_UNSPECIFIED\020\000\022\010\n\004" - + "STOP\020\001\022\016\n\nMAX_TOKENS\020\002\022\n\n\006SAFETY\020\003\022\016\n\nRE" - + "CITATION\020\004\022\t\n\005OTHER\020\005\022\r\n\tBLOCKLIST\020\006\022\026\n\022" - + "PROHIBITED_CONTENT\020\007\022\010\n\004SPII\020\010B\021\n\017_finis" - + "h_message\"\235\001\n\021GroundingMetadata\022\037\n\022web_s" - + "earch_queries\030\001 \003(\tB\003\340A\001\022P\n\022search_entry" - + "_point\030\004 \001(\0132*.google.cloud.vertexai.v1." - + "SearchEntryPointB\003\340A\001H\000\210\001\001B\025\n\023_search_en" - + "try_point\"H\n\020SearchEntryPoint\022\035\n\020rendere" - + "d_content\030\001 \001(\tB\003\340A\001\022\025\n\010sdk_blob\030\002 \001(\014B\003" - + "\340A\001*\264\001\n\014HarmCategory\022\035\n\031HARM_CATEGORY_UN" - + "SPECIFIED\020\000\022\035\n\031HARM_CATEGORY_HATE_SPEECH" - + "\020\001\022#\n\037HARM_CATEGORY_DANGEROUS_CONTENT\020\002\022" - + "\034\n\030HARM_CATEGORY_HARASSMENT\020\003\022#\n\037HARM_CA" - + "TEGORY_SEXUALLY_EXPLICIT\020\004B\311\001\n\035com.googl" - + "e.cloud.vertexai.apiB\014ContentProtoP\001Z>cl" - + "oud.google.com/go/aiplatform/apiv1/aipla" - + "tformpb;aiplatformpb\252\002\032Google.Cloud.AIPl" - + "atform.V1\312\002\032Google\\Cloud\\AIPlatform\\V1\352\002" - + "\035Google::Cloud::AIPlatform::V1b\006proto3" + + "HarmBlockMethodB\003\340A\001\"\235\001\n\022HarmBlockThresh" + + "old\022$\n HARM_BLOCK_THRESHOLD_UNSPECIFIED\020" + + "\000\022\027\n\023BLOCK_LOW_AND_ABOVE\020\001\022\032\n\026BLOCK_MEDI" + + "UM_AND_ABOVE\020\002\022\023\n\017BLOCK_ONLY_HIGH\020\003\022\016\n\nB" + + "LOCK_NONE\020\004\022\007\n\003OFF\020\005\"S\n\017HarmBlockMethod\022" + + "!\n\035HARM_BLOCK_METHOD_UNSPECIFIED\020\000\022\014\n\010SE" + + "VERITY\020\001\022\017\n\013PROBABILITY\020\002\"\271\004\n\014SafetyRati" + + "ng\022=\n\010category\030\001 \001(\0162&.google.cloud.vert" + + "exai.v1.HarmCategoryB\003\340A\003\022P\n\013probability" + + "\030\002 \001(\01626.google.cloud.vertexai.v1.Safety" + + "Rating.HarmProbabilityB\003\340A\003\022\036\n\021probabili" + + "ty_score\030\005 \001(\002B\003\340A\003\022J\n\010severity\030\006 \001(\01623." + + "google.cloud.vertexai.v1.SafetyRating.Ha" + + "rmSeverityB\003\340A\003\022\033\n\016severity_score\030\007 \001(\002B" + + "\003\340A\003\022\024\n\007blocked\030\003 \001(\010B\003\340A\003\"b\n\017HarmProbab" + + "ility\022 \n\034HARM_PROBABILITY_UNSPECIFIED\020\000\022" + + "\016\n\nNEGLIGIBLE\020\001\022\007\n\003LOW\020\002\022\n\n\006MEDIUM\020\003\022\010\n\004" + + "HIGH\020\004\"\224\001\n\014HarmSeverity\022\035\n\031HARM_SEVERITY" + + "_UNSPECIFIED\020\000\022\034\n\030HARM_SEVERITY_NEGLIGIB" + + "LE\020\001\022\025\n\021HARM_SEVERITY_LOW\020\002\022\030\n\024HARM_SEVE" + + "RITY_MEDIUM\020\003\022\026\n\022HARM_SEVERITY_HIGH\020\004\"N\n" + + "\020CitationMetadata\022:\n\tcitations\030\001 \003(\0132\".g" + + "oogle.cloud.vertexai.v1.CitationB\003\340A\003\"\252\001" + + "\n\010Citation\022\030\n\013start_index\030\001 \001(\005B\003\340A\003\022\026\n\t" + + "end_index\030\002 \001(\005B\003\340A\003\022\020\n\003uri\030\003 \001(\tB\003\340A\003\022\022" + + "\n\005title\030\004 \001(\tB\003\340A\003\022\024\n\007license\030\005 \001(\tB\003\340A\003" + + "\0220\n\020publication_date\030\006 \001(\0132\021.google.type" + + ".DateB\003\340A\003\"\250\005\n\tCandidate\022\022\n\005index\030\001 \001(\005B" + + "\003\340A\003\0227\n\007content\030\002 \001(\0132!.google.cloud.ver" + + "texai.v1.ContentB\003\340A\003\022\022\n\005score\030\010 \001(\001B\003\340A" + + "\003\022\031\n\014avg_logprobs\030\t \001(\001B\003\340A\003\022L\n\rfinish_r" + + "eason\030\003 \001(\01620.google.cloud.vertexai.v1.C" + + "andidate.FinishReasonB\003\340A\003\022C\n\016safety_rat" + + "ings\030\004 \003(\0132&.google.cloud.vertexai.v1.Sa" + + "fetyRatingB\003\340A\003\022 \n\016finish_message\030\005 \001(\tB" + + "\003\340A\003H\000\210\001\001\022J\n\021citation_metadata\030\006 \001(\0132*.g" + + "oogle.cloud.vertexai.v1.CitationMetadata" + + "B\003\340A\003\022L\n\022grounding_metadata\030\007 \001(\0132+.goog" + + "le.cloud.vertexai.v1.GroundingMetadataB\003" + + "\340A\003\"\274\001\n\014FinishReason\022\035\n\031FINISH_REASON_UN" + + "SPECIFIED\020\000\022\010\n\004STOP\020\001\022\016\n\nMAX_TOKENS\020\002\022\n\n" + + "\006SAFETY\020\003\022\016\n\nRECITATION\020\004\022\t\n\005OTHER\020\005\022\r\n\t" + + "BLOCKLIST\020\006\022\026\n\022PROHIBITED_CONTENT\020\007\022\010\n\004S" + + "PII\020\010\022\033\n\027MALFORMED_FUNCTION_CALL\020\tB\021\n\017_f" + + "inish_message\"g\n\007Segment\022\027\n\npart_index\030\001" + + " \001(\005B\003\340A\003\022\030\n\013start_index\030\002 \001(\005B\003\340A\003\022\026\n\te" + + "nd_index\030\003 \001(\005B\003\340A\003\022\021\n\004text\030\004 \001(\tB\003\340A\003\"\276" + + "\002\n\016GroundingChunk\022;\n\003web\030\001 \001(\0132,.google." + + "cloud.vertexai.v1.GroundingChunk.WebH\000\022V" + + "\n\021retrieved_context\030\002 \001(\01329.google.cloud" + + ".vertexai.v1.GroundingChunk.RetrievedCon" + + "textH\000\032=\n\003Web\022\020\n\003uri\030\001 \001(\tH\000\210\001\001\022\022\n\005title" + + "\030\002 \001(\tH\001\210\001\001B\006\n\004_uriB\010\n\006_title\032J\n\020Retriev" + + "edContext\022\020\n\003uri\030\001 \001(\tH\000\210\001\001\022\022\n\005title\030\002 \001" + + "(\tH\001\210\001\001B\006\n\004_uriB\010\n\006_titleB\014\n\nchunk_type\"" + + "\223\001\n\020GroundingSupport\0227\n\007segment\030\001 \001(\0132!." + + "google.cloud.vertexai.v1.SegmentH\000\210\001\001\022\037\n" + + "\027grounding_chunk_indices\030\002 \003(\005\022\031\n\021confid" + + "ence_scores\030\003 \003(\002B\n\n\010_segment\"\256\002\n\021Ground" + + "ingMetadata\022\037\n\022web_search_queries\030\001 \003(\tB" + + "\003\340A\001\022P\n\022search_entry_point\030\004 \001(\0132*.googl" + + "e.cloud.vertexai.v1.SearchEntryPointB\003\340A" + + "\001H\000\210\001\001\022B\n\020grounding_chunks\030\005 \003(\0132(.googl" + + "e.cloud.vertexai.v1.GroundingChunk\022K\n\022gr" + + "ounding_supports\030\006 \003(\0132*.google.cloud.ve" + + "rtexai.v1.GroundingSupportB\003\340A\001B\025\n\023_sear" + + "ch_entry_point\"H\n\020SearchEntryPoint\022\035\n\020re" + + "ndered_content\030\001 \001(\tB\003\340A\001\022\025\n\010sdk_blob\030\002 " + + "\001(\014B\003\340A\001*\264\001\n\014HarmCategory\022\035\n\031HARM_CATEGO" + + "RY_UNSPECIFIED\020\000\022\035\n\031HARM_CATEGORY_HATE_S" + + "PEECH\020\001\022#\n\037HARM_CATEGORY_DANGEROUS_CONTE" + + "NT\020\002\022\034\n\030HARM_CATEGORY_HARASSMENT\020\003\022#\n\037HA" + + "RM_CATEGORY_SEXUALLY_EXPLICIT\020\004B\311\001\n\035com." + + "google.cloud.vertexai.apiB\014ContentProtoP" + + "\001Z>cloud.google.com/go/aiplatform/apiv1/" + + "aiplatformpb;aiplatformpb\252\002\032Google.Cloud" + + ".AIPlatform.V1\312\002\032Google\\Cloud\\AIPlatform" + + "\\V1\352\002\035Google::Cloud::AIPlatform::V1b\006pro" + + "to3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -261,8 +332,40 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "StopSequences", "PresencePenalty", "FrequencyPenalty", + "Seed", "ResponseMimeType", "ResponseSchema", + "RoutingConfig", + }); + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_descriptor = + internal_static_google_cloud_vertexai_v1_GenerationConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_descriptor, + new java.lang.String[] { + "AutoMode", "ManualMode", "RoutingConfig", + }); + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_AutoRoutingMode_descriptor = + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_AutoRoutingMode_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_AutoRoutingMode_descriptor, + new java.lang.String[] { + "ModelRoutingPreference", + }); + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_ManualRoutingMode_descriptor = + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_ManualRoutingMode_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_ManualRoutingMode_descriptor, + new java.lang.String[] { + "ModelName", }); internal_static_google_cloud_vertexai_v1_SafetySetting_descriptor = getDescriptor().getMessageTypes().get(6); @@ -304,22 +407,64 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Index", "Content", + "Score", + "AvgLogprobs", "FinishReason", "SafetyRatings", "FinishMessage", "CitationMetadata", "GroundingMetadata", }); - internal_static_google_cloud_vertexai_v1_GroundingMetadata_descriptor = + internal_static_google_cloud_vertexai_v1_Segment_descriptor = getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_vertexai_v1_Segment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1_Segment_descriptor, + new java.lang.String[] { + "PartIndex", "StartIndex", "EndIndex", "Text", + }); + internal_static_google_cloud_vertexai_v1_GroundingChunk_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_vertexai_v1_GroundingChunk_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1_GroundingChunk_descriptor, + new java.lang.String[] { + "Web", "RetrievedContext", "ChunkType", + }); + internal_static_google_cloud_vertexai_v1_GroundingChunk_Web_descriptor = + internal_static_google_cloud_vertexai_v1_GroundingChunk_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_vertexai_v1_GroundingChunk_Web_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1_GroundingChunk_Web_descriptor, + new java.lang.String[] { + "Uri", "Title", + }); + internal_static_google_cloud_vertexai_v1_GroundingChunk_RetrievedContext_descriptor = + internal_static_google_cloud_vertexai_v1_GroundingChunk_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_vertexai_v1_GroundingChunk_RetrievedContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1_GroundingChunk_RetrievedContext_descriptor, + new java.lang.String[] { + "Uri", "Title", + }); + internal_static_google_cloud_vertexai_v1_GroundingSupport_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_vertexai_v1_GroundingSupport_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1_GroundingSupport_descriptor, + new java.lang.String[] { + "Segment", "GroundingChunkIndices", "ConfidenceScores", + }); + internal_static_google_cloud_vertexai_v1_GroundingMetadata_descriptor = + getDescriptor().getMessageTypes().get(14); internal_static_google_cloud_vertexai_v1_GroundingMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_vertexai_v1_GroundingMetadata_descriptor, new java.lang.String[] { - "WebSearchQueries", "SearchEntryPoint", + "WebSearchQueries", "SearchEntryPoint", "GroundingChunks", "GroundingSupports", }); internal_static_google_cloud_vertexai_v1_SearchEntryPoint_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(15); internal_static_google_cloud_vertexai_v1_SearchEntryPoint_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_vertexai_v1_SearchEntryPoint_descriptor, diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequest.java index ce1d29872209..4100979dd311 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequest.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequest.java @@ -43,6 +43,7 @@ private CountTokensRequest() { model_ = ""; instances_ = java.util.Collections.emptyList(); contents_ = java.util.Collections.emptyList(); + tools_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -66,6 +67,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.vertexai.api.CountTokensRequest.Builder.class); } + private int bitField0_; public static final int ENDPOINT_FIELD_NUMBER = 1; @SuppressWarnings("serial") @@ -133,12 +135,12 @@ public com.google.protobuf.ByteString getEndpointBytes() { * * *
-   * Required. The name of the publisher model requested to serve the
+   * Optional. The name of the publisher model requested to serve the
    * prediction. Format:
    * `projects/{project}/locations/{location}/publishers/*/models/*`
    * 
* - * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The model. */ @@ -158,12 +160,12 @@ public java.lang.String getModel() { * * *
-   * Required. The name of the publisher model requested to serve the
+   * Optional. The name of the publisher model requested to serve the
    * prediction. Format:
    * `projects/{project}/locations/{location}/publishers/*/models/*`
    * 
* - * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for model. */ @@ -188,11 +190,11 @@ public com.google.protobuf.ByteString getModelBytes() { * * *
-   * Required. The instances that are the input to token counting call.
+   * Optional. The instances that are the input to token counting call.
    * Schema is identical to the prediction schema of the underlying model.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -203,11 +205,11 @@ public java.util.List getInstancesList() { * * *
-   * Required. The instances that are the input to token counting call.
+   * Optional. The instances that are the input to token counting call.
    * Schema is identical to the prediction schema of the underlying model.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -218,11 +220,11 @@ public java.util.List getInstances * * *
-   * Required. The instances that are the input to token counting call.
+   * Optional. The instances that are the input to token counting call.
    * Schema is identical to the prediction schema of the underlying model.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -233,11 +235,11 @@ public int getInstancesCount() { * * *
-   * Required. The instances that are the input to token counting call.
+   * Optional. The instances that are the input to token counting call.
    * Schema is identical to the prediction schema of the underlying model.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -248,11 +250,11 @@ public com.google.protobuf.Value getInstances(int index) { * * *
-   * Required. The instances that are the input to token counting call.
+   * Optional. The instances that are the input to token counting call.
    * Schema is identical to the prediction schema of the underlying model.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -268,11 +270,11 @@ public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { * * *
-   * Required. Input content.
+   * Optional. Input content.
    * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -283,11 +285,11 @@ public java.util.List getContentsList() { * * *
-   * Required. Input content.
+   * Optional. Input content.
    * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -299,11 +301,11 @@ public java.util.List getContentsList() { * * *
-   * Required. Input content.
+   * Optional. Input content.
    * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -314,11 +316,11 @@ public int getContentsCount() { * * *
-   * Required. Input content.
+   * Optional. Input content.
    * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -329,11 +331,11 @@ public com.google.cloud.vertexai.api.Content getContents(int index) { * * *
-   * Required. Input content.
+   * Optional. Input content.
    * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override @@ -341,6 +343,174 @@ public com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int i return contents_.get(index); } + public static final int SYSTEM_INSTRUCTION_FIELD_NUMBER = 5; + private com.google.cloud.vertexai.api.Content systemInstruction_; + /** + * + * + *
+   * Optional. The user provided system instructions for the model.
+   * Note: only text should be used in parts and content in each part will be in
+   * a separate paragraph.
+   * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the systemInstruction field is set. + */ + @java.lang.Override + public boolean hasSystemInstruction() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. The user provided system instructions for the model.
+   * Note: only text should be used in parts and content in each part will be in
+   * a separate paragraph.
+   * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The systemInstruction. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Content getSystemInstruction() { + return systemInstruction_ == null + ? com.google.cloud.vertexai.api.Content.getDefaultInstance() + : systemInstruction_; + } + /** + * + * + *
+   * Optional. The user provided system instructions for the model.
+   * Note: only text should be used in parts and content in each part will be in
+   * a separate paragraph.
+   * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ContentOrBuilder getSystemInstructionOrBuilder() { + return systemInstruction_ == null + ? com.google.cloud.vertexai.api.Content.getDefaultInstance() + : systemInstruction_; + } + + public static final int TOOLS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private java.util.List tools_; + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getToolsList() { + return tools_; + } + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getToolsOrBuilderList() { + return tools_; + } + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getToolsCount() { + return tools_.size(); + } + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Tool getTools(int index) { + return tools_.get(index); + } + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ToolOrBuilder getToolsOrBuilder(int index) { + return tools_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -367,6 +537,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < contents_.size(); i++) { output.writeMessage(4, contents_.get(i)); } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getSystemInstruction()); + } + for (int i = 0; i < tools_.size(); i++) { + output.writeMessage(6, tools_.get(i)); + } getUnknownFields().writeTo(output); } @@ -388,6 +564,12 @@ public int getSerializedSize() { for (int i = 0; i < contents_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, contents_.get(i)); } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getSystemInstruction()); + } + for (int i = 0; i < tools_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, tools_.get(i)); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -408,6 +590,11 @@ public boolean equals(final java.lang.Object obj) { if (!getModel().equals(other.getModel())) return false; if (!getInstancesList().equals(other.getInstancesList())) return false; if (!getContentsList().equals(other.getContentsList())) return false; + if (hasSystemInstruction() != other.hasSystemInstruction()) return false; + if (hasSystemInstruction()) { + if (!getSystemInstruction().equals(other.getSystemInstruction())) return false; + } + if (!getToolsList().equals(other.getToolsList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -431,6 +618,14 @@ public int hashCode() { hash = (37 * hash) + CONTENTS_FIELD_NUMBER; hash = (53 * hash) + getContentsList().hashCode(); } + if (hasSystemInstruction()) { + hash = (37 * hash) + SYSTEM_INSTRUCTION_FIELD_NUMBER; + hash = (53 * hash) + getSystemInstruction().hashCode(); + } + if (getToolsCount() > 0) { + hash = (37 * hash) + TOOLS_FIELD_NUMBER; + hash = (53 * hash) + getToolsList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -560,10 +755,22 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.vertexai.api.CountTokensRequest.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInstancesFieldBuilder(); + getContentsFieldBuilder(); + getSystemInstructionFieldBuilder(); + getToolsFieldBuilder(); + } } @java.lang.Override @@ -586,6 +793,18 @@ public Builder clear() { contentsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); + systemInstruction_ = null; + if (systemInstructionBuilder_ != null) { + systemInstructionBuilder_.dispose(); + systemInstructionBuilder_ = null; + } + if (toolsBuilder_ == null) { + tools_ = java.util.Collections.emptyList(); + } else { + tools_ = null; + toolsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); return this; } @@ -641,6 +860,15 @@ private void buildPartialRepeatedFields( } else { result.contents_ = contentsBuilder_.build(); } + if (toolsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + tools_ = java.util.Collections.unmodifiableList(tools_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.tools_ = tools_; + } else { + result.tools_ = toolsBuilder_.build(); + } } private void buildPartial0(com.google.cloud.vertexai.api.CountTokensRequest result) { @@ -651,6 +879,15 @@ private void buildPartial0(com.google.cloud.vertexai.api.CountTokensRequest resu if (((from_bitField0_ & 0x00000002) != 0)) { result.model_ = model_; } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.systemInstruction_ = + systemInstructionBuilder_ == null + ? systemInstruction_ + : systemInstructionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -763,6 +1000,36 @@ public Builder mergeFrom(com.google.cloud.vertexai.api.CountTokensRequest other) } } } + if (other.hasSystemInstruction()) { + mergeSystemInstruction(other.getSystemInstruction()); + } + if (toolsBuilder_ == null) { + if (!other.tools_.isEmpty()) { + if (tools_.isEmpty()) { + tools_ = other.tools_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureToolsIsMutable(); + tools_.addAll(other.tools_); + } + onChanged(); + } + } else { + if (!other.tools_.isEmpty()) { + if (toolsBuilder_.isEmpty()) { + toolsBuilder_.dispose(); + toolsBuilder_ = null; + tools_ = other.tools_; + bitField0_ = (bitField0_ & ~0x00000020); + toolsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getToolsFieldBuilder() + : null; + } else { + toolsBuilder_.addAllMessages(other.tools_); + } + } + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -826,6 +1093,26 @@ public Builder mergeFrom( } break; } // case 34 + case 42: + { + input.readMessage( + getSystemInstructionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + com.google.cloud.vertexai.api.Tool m = + input.readMessage( + com.google.cloud.vertexai.api.Tool.parser(), extensionRegistry); + if (toolsBuilder_ == null) { + ensureToolsIsMutable(); + tools_.add(m); + } else { + toolsBuilder_.addMessage(m); + } + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -976,12 +1263,12 @@ public Builder setEndpointBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. The name of the publisher model requested to serve the
+     * Optional. The name of the publisher model requested to serve the
      * prediction. Format:
      * `projects/{project}/locations/{location}/publishers/*/models/*`
      * 
* - * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The model. */ @@ -1000,12 +1287,12 @@ public java.lang.String getModel() { * * *
-     * Required. The name of the publisher model requested to serve the
+     * Optional. The name of the publisher model requested to serve the
      * prediction. Format:
      * `projects/{project}/locations/{location}/publishers/*/models/*`
      * 
* - * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for model. */ @@ -1024,12 +1311,12 @@ public com.google.protobuf.ByteString getModelBytes() { * * *
-     * Required. The name of the publisher model requested to serve the
+     * Optional. The name of the publisher model requested to serve the
      * prediction. Format:
      * `projects/{project}/locations/{location}/publishers/*/models/*`
      * 
* - * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The model to set. * @return This builder for chaining. @@ -1047,12 +1334,12 @@ public Builder setModel(java.lang.String value) { * * *
-     * Required. The name of the publisher model requested to serve the
+     * Optional. The name of the publisher model requested to serve the
      * prediction. Format:
      * `projects/{project}/locations/{location}/publishers/*/models/*`
      * 
* - * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -1066,12 +1353,12 @@ public Builder clearModel() { * * *
-     * Required. The name of the publisher model requested to serve the
+     * Optional. The name of the publisher model requested to serve the
      * prediction. Format:
      * `projects/{project}/locations/{location}/publishers/*/models/*`
      * 
* - * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for model to set. * @return This builder for chaining. @@ -1107,12 +1394,12 @@ private void ensureInstancesIsMutable() { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public java.util.List getInstancesList() { @@ -1126,12 +1413,12 @@ public java.util.List getInstancesList() { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public int getInstancesCount() { @@ -1145,12 +1432,12 @@ public int getInstancesCount() { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.protobuf.Value getInstances(int index) { @@ -1164,12 +1451,12 @@ public com.google.protobuf.Value getInstances(int index) { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setInstances(int index, com.google.protobuf.Value value) { @@ -1189,12 +1476,12 @@ public Builder setInstances(int index, com.google.protobuf.Value value) { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setInstances(int index, com.google.protobuf.Value.Builder builderForValue) { @@ -1211,12 +1498,12 @@ public Builder setInstances(int index, com.google.protobuf.Value.Builder builder * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addInstances(com.google.protobuf.Value value) { @@ -1236,12 +1523,12 @@ public Builder addInstances(com.google.protobuf.Value value) { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addInstances(int index, com.google.protobuf.Value value) { @@ -1261,12 +1548,12 @@ public Builder addInstances(int index, com.google.protobuf.Value value) { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addInstances(com.google.protobuf.Value.Builder builderForValue) { @@ -1283,12 +1570,12 @@ public Builder addInstances(com.google.protobuf.Value.Builder builderForValue) { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addInstances(int index, com.google.protobuf.Value.Builder builderForValue) { @@ -1305,12 +1592,12 @@ public Builder addInstances(int index, com.google.protobuf.Value.Builder builder * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addAllInstances(java.lang.Iterable values) { @@ -1327,12 +1614,12 @@ public Builder addAllInstances(java.lang.Iterable - * Required. The instances that are the input to token counting call. + * Optional. The instances that are the input to token counting call. * Schema is identical to the prediction schema of the underlying model. * * * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder clearInstances() { @@ -1349,12 +1636,12 @@ public Builder clearInstances() { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder removeInstances(int index) { @@ -1371,12 +1658,12 @@ public Builder removeInstances(int index) { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.protobuf.Value.Builder getInstancesBuilder(int index) { @@ -1386,12 +1673,12 @@ public com.google.protobuf.Value.Builder getInstancesBuilder(int index) { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { @@ -1405,12 +1692,12 @@ public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public java.util.List @@ -1425,12 +1712,12 @@ public com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index) { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.protobuf.Value.Builder addInstancesBuilder() { @@ -1440,12 +1727,12 @@ public com.google.protobuf.Value.Builder addInstancesBuilder() { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.protobuf.Value.Builder addInstancesBuilder(int index) { @@ -1456,12 +1743,12 @@ public com.google.protobuf.Value.Builder addInstancesBuilder(int index) { * * *
-     * Required. The instances that are the input to token counting call.
+     * Optional. The instances that are the input to token counting call.
      * Schema is identical to the prediction schema of the underlying model.
      * 
* * - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ public java.util.List getInstancesBuilderList() { @@ -1505,11 +1792,11 @@ private void ensureContentsIsMutable() { * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public java.util.List getContentsList() { @@ -1523,11 +1810,11 @@ public java.util.List getContentsList() { * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public int getContentsCount() { @@ -1541,11 +1828,11 @@ public int getContentsCount() { * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.cloud.vertexai.api.Content getContents(int index) { @@ -1559,11 +1846,11 @@ public com.google.cloud.vertexai.api.Content getContents(int index) { * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setContents(int index, com.google.cloud.vertexai.api.Content value) { @@ -1583,11 +1870,11 @@ public Builder setContents(int index, com.google.cloud.vertexai.api.Content valu * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setContents( @@ -1605,11 +1892,11 @@ public Builder setContents( * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addContents(com.google.cloud.vertexai.api.Content value) { @@ -1629,11 +1916,11 @@ public Builder addContents(com.google.cloud.vertexai.api.Content value) { * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addContents(int index, com.google.cloud.vertexai.api.Content value) { @@ -1653,11 +1940,11 @@ public Builder addContents(int index, com.google.cloud.vertexai.api.Content valu * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addContents(com.google.cloud.vertexai.api.Content.Builder builderForValue) { @@ -1674,11 +1961,11 @@ public Builder addContents(com.google.cloud.vertexai.api.Content.Builder builder * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addContents( @@ -1696,11 +1983,11 @@ public Builder addContents( * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder addAllContents( @@ -1718,11 +2005,11 @@ public Builder addAllContents( * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder clearContents() { @@ -1739,11 +2026,11 @@ public Builder clearContents() { * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder removeContents(int index) { @@ -1760,11 +2047,11 @@ public Builder removeContents(int index) { * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.cloud.vertexai.api.Content.Builder getContentsBuilder(int index) { @@ -1774,11 +2061,11 @@ public com.google.cloud.vertexai.api.Content.Builder getContentsBuilder(int inde * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int index) { @@ -1792,11 +2079,11 @@ public com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int i * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public java.util.List @@ -1811,11 +2098,11 @@ public com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int i * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.cloud.vertexai.api.Content.Builder addContentsBuilder() { @@ -1826,11 +2113,11 @@ public com.google.cloud.vertexai.api.Content.Builder addContentsBuilder() { * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.cloud.vertexai.api.Content.Builder addContentsBuilder(int index) { @@ -1841,11 +2128,11 @@ public com.google.cloud.vertexai.api.Content.Builder addContentsBuilder(int inde * * *
-     * Required. Input content.
+     * Optional. Input content.
      * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ public java.util.List getContentsBuilderList() { @@ -1869,6 +2156,700 @@ public java.util.List getContents return contentsBuilder_; } + private com.google.cloud.vertexai.api.Content systemInstruction_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder> + systemInstructionBuilder_; + /** + * + * + *
+     * Optional. The user provided system instructions for the model.
+     * Note: only text should be used in parts and content in each part will be in
+     * a separate paragraph.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the systemInstruction field is set. + */ + public boolean hasSystemInstruction() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Optional. The user provided system instructions for the model.
+     * Note: only text should be used in parts and content in each part will be in
+     * a separate paragraph.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The systemInstruction. + */ + public com.google.cloud.vertexai.api.Content getSystemInstruction() { + if (systemInstructionBuilder_ == null) { + return systemInstruction_ == null + ? com.google.cloud.vertexai.api.Content.getDefaultInstance() + : systemInstruction_; + } else { + return systemInstructionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The user provided system instructions for the model.
+     * Note: only text should be used in parts and content in each part will be in
+     * a separate paragraph.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSystemInstruction(com.google.cloud.vertexai.api.Content value) { + if (systemInstructionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + systemInstruction_ = value; + } else { + systemInstructionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The user provided system instructions for the model.
+     * Note: only text should be used in parts and content in each part will be in
+     * a separate paragraph.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSystemInstruction( + com.google.cloud.vertexai.api.Content.Builder builderForValue) { + if (systemInstructionBuilder_ == null) { + systemInstruction_ = builderForValue.build(); + } else { + systemInstructionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The user provided system instructions for the model.
+     * Note: only text should be used in parts and content in each part will be in
+     * a separate paragraph.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeSystemInstruction(com.google.cloud.vertexai.api.Content value) { + if (systemInstructionBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && systemInstruction_ != null + && systemInstruction_ != com.google.cloud.vertexai.api.Content.getDefaultInstance()) { + getSystemInstructionBuilder().mergeFrom(value); + } else { + systemInstruction_ = value; + } + } else { + systemInstructionBuilder_.mergeFrom(value); + } + if (systemInstruction_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The user provided system instructions for the model.
+     * Note: only text should be used in parts and content in each part will be in
+     * a separate paragraph.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSystemInstruction() { + bitField0_ = (bitField0_ & ~0x00000010); + systemInstruction_ = null; + if (systemInstructionBuilder_ != null) { + systemInstructionBuilder_.dispose(); + systemInstructionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The user provided system instructions for the model.
+     * Note: only text should be used in parts and content in each part will be in
+     * a separate paragraph.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Content.Builder getSystemInstructionBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getSystemInstructionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The user provided system instructions for the model.
+     * Note: only text should be used in parts and content in each part will be in
+     * a separate paragraph.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.ContentOrBuilder getSystemInstructionOrBuilder() { + if (systemInstructionBuilder_ != null) { + return systemInstructionBuilder_.getMessageOrBuilder(); + } else { + return systemInstruction_ == null + ? com.google.cloud.vertexai.api.Content.getDefaultInstance() + : systemInstruction_; + } + } + /** + * + * + *
+     * Optional. The user provided system instructions for the model.
+     * Note: only text should be used in parts and content in each part will be in
+     * a separate paragraph.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder> + getSystemInstructionFieldBuilder() { + if (systemInstructionBuilder_ == null) { + systemInstructionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Content, + com.google.cloud.vertexai.api.Content.Builder, + com.google.cloud.vertexai.api.ContentOrBuilder>( + getSystemInstruction(), getParentForChildren(), isClean()); + systemInstruction_ = null; + } + return systemInstructionBuilder_; + } + + private java.util.List tools_ = + java.util.Collections.emptyList(); + + private void ensureToolsIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + tools_ = new java.util.ArrayList(tools_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tool, + com.google.cloud.vertexai.api.Tool.Builder, + com.google.cloud.vertexai.api.ToolOrBuilder> + toolsBuilder_; + + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getToolsList() { + if (toolsBuilder_ == null) { + return java.util.Collections.unmodifiableList(tools_); + } else { + return toolsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getToolsCount() { + if (toolsBuilder_ == null) { + return tools_.size(); + } else { + return toolsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Tool getTools(int index) { + if (toolsBuilder_ == null) { + return tools_.get(index); + } else { + return toolsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTools(int index, com.google.cloud.vertexai.api.Tool value) { + if (toolsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureToolsIsMutable(); + tools_.set(index, value); + onChanged(); + } else { + toolsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTools(int index, com.google.cloud.vertexai.api.Tool.Builder builderForValue) { + if (toolsBuilder_ == null) { + ensureToolsIsMutable(); + tools_.set(index, builderForValue.build()); + onChanged(); + } else { + toolsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTools(com.google.cloud.vertexai.api.Tool value) { + if (toolsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureToolsIsMutable(); + tools_.add(value); + onChanged(); + } else { + toolsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTools(int index, com.google.cloud.vertexai.api.Tool value) { + if (toolsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureToolsIsMutable(); + tools_.add(index, value); + onChanged(); + } else { + toolsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTools(com.google.cloud.vertexai.api.Tool.Builder builderForValue) { + if (toolsBuilder_ == null) { + ensureToolsIsMutable(); + tools_.add(builderForValue.build()); + onChanged(); + } else { + toolsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addTools(int index, com.google.cloud.vertexai.api.Tool.Builder builderForValue) { + if (toolsBuilder_ == null) { + ensureToolsIsMutable(); + tools_.add(index, builderForValue.build()); + onChanged(); + } else { + toolsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllTools( + java.lang.Iterable values) { + if (toolsBuilder_ == null) { + ensureToolsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tools_); + onChanged(); + } else { + toolsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTools() { + if (toolsBuilder_ == null) { + tools_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + toolsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeTools(int index) { + if (toolsBuilder_ == null) { + ensureToolsIsMutable(); + tools_.remove(index); + onChanged(); + } else { + toolsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Tool.Builder getToolsBuilder(int index) { + return getToolsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.ToolOrBuilder getToolsOrBuilder(int index) { + if (toolsBuilder_ == null) { + return tools_.get(index); + } else { + return toolsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getToolsOrBuilderList() { + if (toolsBuilder_ != null) { + return toolsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tools_); + } + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Tool.Builder addToolsBuilder() { + return getToolsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.Tool.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.Tool.Builder addToolsBuilder(int index) { + return getToolsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.Tool.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A list of `Tools` the model may use to generate the next
+     * response.
+     *
+     * A `Tool` is a piece of code that enables the system to interact with
+     * external systems to perform an action, or set of actions, outside of
+     * knowledge and scope of the model.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getToolsBuilderList() { + return getToolsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tool, + com.google.cloud.vertexai.api.Tool.Builder, + com.google.cloud.vertexai.api.ToolOrBuilder> + getToolsFieldBuilder() { + if (toolsBuilder_ == null) { + toolsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.Tool, + com.google.cloud.vertexai.api.Tool.Builder, + com.google.cloud.vertexai.api.ToolOrBuilder>( + tools_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); + tools_ = null; + } + return toolsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequestOrBuilder.java index 2d8c41c079cc..2bd233689ffc 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequestOrBuilder.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/CountTokensRequestOrBuilder.java @@ -61,12 +61,12 @@ public interface CountTokensRequestOrBuilder * * *
-   * Required. The name of the publisher model requested to serve the
+   * Optional. The name of the publisher model requested to serve the
    * prediction. Format:
    * `projects/{project}/locations/{location}/publishers/*/models/*`
    * 
* - * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The model. */ @@ -75,12 +75,12 @@ public interface CountTokensRequestOrBuilder * * *
-   * Required. The name of the publisher model requested to serve the
+   * Optional. The name of the publisher model requested to serve the
    * prediction. Format:
    * `projects/{project}/locations/{location}/publishers/*/models/*`
    * 
* - * string model = 3 [(.google.api.field_behavior) = REQUIRED]; + * string model = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for model. */ @@ -90,11 +90,11 @@ public interface CountTokensRequestOrBuilder * * *
-   * Required. The instances that are the input to token counting call.
+   * Optional. The instances that are the input to token counting call.
    * Schema is identical to the prediction schema of the underlying model.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ java.util.List getInstancesList(); @@ -102,11 +102,11 @@ public interface CountTokensRequestOrBuilder * * *
-   * Required. The instances that are the input to token counting call.
+   * Optional. The instances that are the input to token counting call.
    * Schema is identical to the prediction schema of the underlying model.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ com.google.protobuf.Value getInstances(int index); @@ -114,11 +114,11 @@ public interface CountTokensRequestOrBuilder * * *
-   * Required. The instances that are the input to token counting call.
+   * Optional. The instances that are the input to token counting call.
    * Schema is identical to the prediction schema of the underlying model.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ int getInstancesCount(); @@ -126,11 +126,11 @@ public interface CountTokensRequestOrBuilder * * *
-   * Required. The instances that are the input to token counting call.
+   * Optional. The instances that are the input to token counting call.
    * Schema is identical to the prediction schema of the underlying model.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ java.util.List getInstancesOrBuilderList(); @@ -138,11 +138,11 @@ public interface CountTokensRequestOrBuilder * * *
-   * Required. The instances that are the input to token counting call.
+   * Optional. The instances that are the input to token counting call.
    * Schema is identical to the prediction schema of the underlying model.
    * 
* - * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = OPTIONAL]; * */ com.google.protobuf.ValueOrBuilder getInstancesOrBuilder(int index); @@ -151,11 +151,11 @@ public interface CountTokensRequestOrBuilder * * *
-   * Required. Input content.
+   * Optional. Input content.
    * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ java.util.List getContentsList(); @@ -163,11 +163,11 @@ public interface CountTokensRequestOrBuilder * * *
-   * Required. Input content.
+   * Optional. Input content.
    * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ com.google.cloud.vertexai.api.Content getContents(int index); @@ -175,11 +175,11 @@ public interface CountTokensRequestOrBuilder * * *
-   * Required. Input content.
+   * Optional. Input content.
    * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ int getContentsCount(); @@ -187,11 +187,11 @@ public interface CountTokensRequestOrBuilder * * *
-   * Required. Input content.
+   * Optional. Input content.
    * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ java.util.List @@ -200,12 +200,145 @@ public interface CountTokensRequestOrBuilder * * *
-   * Required. Input content.
+   * Optional. Input content.
    * 
* * - * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED]; + * repeated .google.cloud.vertexai.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL]; * */ com.google.cloud.vertexai.api.ContentOrBuilder getContentsOrBuilder(int index); + + /** + * + * + *
+   * Optional. The user provided system instructions for the model.
+   * Note: only text should be used in parts and content in each part will be in
+   * a separate paragraph.
+   * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the systemInstruction field is set. + */ + boolean hasSystemInstruction(); + /** + * + * + *
+   * Optional. The user provided system instructions for the model.
+   * Note: only text should be used in parts and content in each part will be in
+   * a separate paragraph.
+   * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The systemInstruction. + */ + com.google.cloud.vertexai.api.Content getSystemInstruction(); + /** + * + * + *
+   * Optional. The user provided system instructions for the model.
+   * Note: only text should be used in parts and content in each part will be in
+   * a separate paragraph.
+   * 
+ * + * + * optional .google.cloud.vertexai.v1.Content system_instruction = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.ContentOrBuilder getSystemInstructionOrBuilder(); + + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getToolsList(); + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.Tool getTools(int index); + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getToolsCount(); + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getToolsOrBuilderList(); + /** + * + * + *
+   * Optional. A list of `Tools` the model may use to generate the next
+   * response.
+   *
+   * A `Tool` is a piece of code that enables the system to interact with
+   * external systems to perform an action, or set of actions, outside of
+   * knowledge and scope of the model.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.ToolOrBuilder getToolsOrBuilder(int index); } diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/DedicatedResources.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/DedicatedResources.java index c70fffb2e1be..f86d6bd127c4 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/DedicatedResources.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/DedicatedResources.java @@ -375,6 +375,25 @@ public com.google.cloud.vertexai.api.AutoscalingMetricSpec getAutoscalingMetricS return autoscalingMetricSpecs_.get(index); } + public static final int SPOT_FIELD_NUMBER = 5; + private boolean spot_ = false; + /** + * + * + *
+   * Optional. If true, schedule the deployment workload on [spot
+   * VMs](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms).
+   * 
+ * + * bool spot = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The spot. + */ + @java.lang.Override + public boolean getSpot() { + return spot_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -401,6 +420,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < autoscalingMetricSpecs_.size(); i++) { output.writeMessage(4, autoscalingMetricSpecs_.get(i)); } + if (spot_ != false) { + output.writeBool(5, spot_); + } getUnknownFields().writeTo(output); } @@ -424,6 +446,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 4, autoscalingMetricSpecs_.get(i)); } + if (spot_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, spot_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -448,6 +473,7 @@ public boolean equals(final java.lang.Object obj) { if (getMaxReplicaCount() != other.getMaxReplicaCount()) return false; if (!getAutoscalingMetricSpecsList().equals(other.getAutoscalingMetricSpecsList())) return false; + if (getSpot() != other.getSpot()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -471,6 +497,8 @@ public int hashCode() { hash = (37 * hash) + AUTOSCALING_METRIC_SPECS_FIELD_NUMBER; hash = (53 * hash) + getAutoscalingMetricSpecsList().hashCode(); } + hash = (37 * hash) + SPOT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSpot()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -635,6 +663,7 @@ public Builder clear() { autoscalingMetricSpecsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); + spot_ = false; return this; } @@ -697,6 +726,9 @@ private void buildPartial0(com.google.cloud.vertexai.api.DedicatedResources resu if (((from_bitField0_ & 0x00000004) != 0)) { result.maxReplicaCount_ = maxReplicaCount_; } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.spot_ = spot_; + } result.bitField0_ |= to_bitField0_; } @@ -782,6 +814,9 @@ public Builder mergeFrom(com.google.cloud.vertexai.api.DedicatedResources other) } } } + if (other.getSpot() != false) { + setSpot(other.getSpot()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -840,6 +875,12 @@ public Builder mergeFrom( } break; } // case 34 + case 40: + { + spot_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2038,6 +2079,62 @@ public Builder removeAutoscalingMetricSpecs(int index) { return autoscalingMetricSpecsBuilder_; } + private boolean spot_; + /** + * + * + *
+     * Optional. If true, schedule the deployment workload on [spot
+     * VMs](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms).
+     * 
+ * + * bool spot = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The spot. + */ + @java.lang.Override + public boolean getSpot() { + return spot_; + } + /** + * + * + *
+     * Optional. If true, schedule the deployment workload on [spot
+     * VMs](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms).
+     * 
+ * + * bool spot = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The spot to set. + * @return This builder for chaining. + */ + public Builder setSpot(boolean value) { + + spot_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If true, schedule the deployment workload on [spot
+     * VMs](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms).
+     * 
+ * + * bool spot = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearSpot() { + bitField0_ = (bitField0_ & ~0x00000010); + spot_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/DedicatedResourcesOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/DedicatedResourcesOrBuilder.java index a611be4887ca..28abead121a1 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/DedicatedResourcesOrBuilder.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/DedicatedResourcesOrBuilder.java @@ -288,4 +288,18 @@ public interface DedicatedResourcesOrBuilder */ com.google.cloud.vertexai.api.AutoscalingMetricSpecOrBuilder getAutoscalingMetricSpecsOrBuilder( int index); + + /** + * + * + *
+   * Optional. If true, schedule the deployment workload on [spot
+   * VMs](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms).
+   * 
+ * + * bool spot = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The spot. + */ + boolean getSpot(); } diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Endpoint.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Endpoint.java index f354f74c691a..3ea6081c65b0 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Endpoint.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Endpoint.java @@ -47,6 +47,7 @@ private Endpoint() { etag_ = ""; network_ = ""; modelDeploymentMonitoringJob_ = ""; + dedicatedEndpointDns_ = ""; } @java.lang.Override @@ -1114,6 +1115,123 @@ public boolean hasPredictRequestResponseLoggingConfig() { : predictRequestResponseLoggingConfig_; } + public static final int DEDICATED_ENDPOINT_ENABLED_FIELD_NUMBER = 24; + private boolean dedicatedEndpointEnabled_ = false; + /** + * + * + *
+   * If true, the endpoint will be exposed through a dedicated
+   * DNS [Endpoint.dedicated_endpoint_dns]. Your request to the dedicated DNS
+   * will be isolated from other users' traffic and will have better performance
+   * and reliability.
+   * Note: Once you enabled dedicated endpoint, you won't be able to send
+   * request to the shared DNS {region}-aiplatform.googleapis.com. The
+   * limitation will be removed soon.
+   * 
+ * + * bool dedicated_endpoint_enabled = 24; + * + * @return The dedicatedEndpointEnabled. + */ + @java.lang.Override + public boolean getDedicatedEndpointEnabled() { + return dedicatedEndpointEnabled_; + } + + public static final int DEDICATED_ENDPOINT_DNS_FIELD_NUMBER = 25; + + @SuppressWarnings("serial") + private volatile java.lang.Object dedicatedEndpointDns_ = ""; + /** + * + * + *
+   * Output only. DNS of the dedicated endpoint. Will only be populated if
+   * dedicated_endpoint_enabled is true.
+   * Format:
+   * `https://{endpoint_id}.{region}-{project_number}.prediction.vertexai.goog`.
+   * 
+ * + * string dedicated_endpoint_dns = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dedicatedEndpointDns. + */ + @java.lang.Override + public java.lang.String getDedicatedEndpointDns() { + java.lang.Object ref = dedicatedEndpointDns_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dedicatedEndpointDns_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. DNS of the dedicated endpoint. Will only be populated if
+   * dedicated_endpoint_enabled is true.
+   * Format:
+   * `https://{endpoint_id}.{region}-{project_number}.prediction.vertexai.goog`.
+   * 
+ * + * string dedicated_endpoint_dns = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dedicatedEndpointDns. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDedicatedEndpointDnsBytes() { + java.lang.Object ref = dedicatedEndpointDns_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dedicatedEndpointDns_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SATISFIES_PZS_FIELD_NUMBER = 27; + private boolean satisfiesPzs_ = false; + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public boolean getSatisfiesPzs() { + return satisfiesPzs_; + } + + public static final int SATISFIES_PZI_FIELD_NUMBER = 28; + private boolean satisfiesPzi_ = false; + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * bool satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The satisfiesPzi. + */ + @java.lang.Override + public boolean getSatisfiesPzi() { + return satisfiesPzi_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1171,6 +1289,18 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(21, getPrivateServiceConnectConfig()); } + if (dedicatedEndpointEnabled_ != false) { + output.writeBool(24, dedicatedEndpointEnabled_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dedicatedEndpointDns_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 25, dedicatedEndpointDns_); + } + if (satisfiesPzs_ != false) { + output.writeBool(27, satisfiesPzs_); + } + if (satisfiesPzi_ != false) { + output.writeBool(28, satisfiesPzi_); + } getUnknownFields().writeTo(output); } @@ -1246,6 +1376,18 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 21, getPrivateServiceConnectConfig()); } + if (dedicatedEndpointEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(24, dedicatedEndpointEnabled_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dedicatedEndpointDns_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(25, dedicatedEndpointDns_); + } + if (satisfiesPzs_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(27, satisfiesPzs_); + } + if (satisfiesPzi_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(28, satisfiesPzi_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1295,6 +1437,10 @@ public boolean equals(final java.lang.Object obj) { if (!getPredictRequestResponseLoggingConfig() .equals(other.getPredictRequestResponseLoggingConfig())) return false; } + if (getDedicatedEndpointEnabled() != other.getDedicatedEndpointEnabled()) return false; + if (!getDedicatedEndpointDns().equals(other.getDedicatedEndpointDns())) return false; + if (getSatisfiesPzs() != other.getSatisfiesPzs()) return false; + if (getSatisfiesPzi() != other.getSatisfiesPzi()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1352,6 +1498,14 @@ public int hashCode() { hash = (37 * hash) + PREDICT_REQUEST_RESPONSE_LOGGING_CONFIG_FIELD_NUMBER; hash = (53 * hash) + getPredictRequestResponseLoggingConfig().hashCode(); } + hash = (37 * hash) + DEDICATED_ENDPOINT_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDedicatedEndpointEnabled()); + hash = (37 * hash) + DEDICATED_ENDPOINT_DNS_FIELD_NUMBER; + hash = (53 * hash) + getDedicatedEndpointDns().hashCode(); + hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSatisfiesPzs()); + hash = (37 * hash) + SATISFIES_PZI_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSatisfiesPzi()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1573,6 +1727,10 @@ public Builder clear() { predictRequestResponseLoggingConfigBuilder_.dispose(); predictRequestResponseLoggingConfigBuilder_ = null; } + dedicatedEndpointEnabled_ = false; + dedicatedEndpointDns_ = ""; + satisfiesPzs_ = false; + satisfiesPzi_ = false; return this; } @@ -1679,6 +1837,18 @@ private void buildPartial0(com.google.cloud.vertexai.api.Endpoint result) { : predictRequestResponseLoggingConfigBuilder_.build(); to_bitField0_ |= 0x00000010; } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.dedicatedEndpointEnabled_ = dedicatedEndpointEnabled_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.dedicatedEndpointDns_ = dedicatedEndpointDns_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.satisfiesPzs_ = satisfiesPzs_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.satisfiesPzi_ = satisfiesPzi_; + } result.bitField0_ |= to_bitField0_; } @@ -1806,6 +1976,20 @@ public Builder mergeFrom(com.google.cloud.vertexai.api.Endpoint other) { if (other.hasPredictRequestResponseLoggingConfig()) { mergePredictRequestResponseLoggingConfig(other.getPredictRequestResponseLoggingConfig()); } + if (other.getDedicatedEndpointEnabled() != false) { + setDedicatedEndpointEnabled(other.getDedicatedEndpointEnabled()); + } + if (!other.getDedicatedEndpointDns().isEmpty()) { + dedicatedEndpointDns_ = other.dedicatedEndpointDns_; + bitField0_ |= 0x00010000; + onChanged(); + } + if (other.getSatisfiesPzs() != false) { + setSatisfiesPzs(other.getSatisfiesPzs()); + } + if (other.getSatisfiesPzi() != false) { + setSatisfiesPzi(other.getSatisfiesPzi()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1944,6 +2128,30 @@ public Builder mergeFrom( bitField0_ |= 0x00001000; break; } // case 170 + case 192: + { + dedicatedEndpointEnabled_ = input.readBool(); + bitField0_ |= 0x00008000; + break; + } // case 192 + case 202: + { + dedicatedEndpointDns_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00010000; + break; + } // case 202 + case 216: + { + satisfiesPzs_ = input.readBool(); + bitField0_ |= 0x00020000; + break; + } // case 216 + case 224: + { + satisfiesPzi_ = input.readBool(); + bitField0_ |= 0x00040000; + break; + } // case 224 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -4771,6 +4979,304 @@ public Builder clearPredictRequestResponseLoggingConfig() { return predictRequestResponseLoggingConfigBuilder_; } + private boolean dedicatedEndpointEnabled_; + /** + * + * + *
+     * If true, the endpoint will be exposed through a dedicated
+     * DNS [Endpoint.dedicated_endpoint_dns]. Your request to the dedicated DNS
+     * will be isolated from other users' traffic and will have better performance
+     * and reliability.
+     * Note: Once you enabled dedicated endpoint, you won't be able to send
+     * request to the shared DNS {region}-aiplatform.googleapis.com. The
+     * limitation will be removed soon.
+     * 
+ * + * bool dedicated_endpoint_enabled = 24; + * + * @return The dedicatedEndpointEnabled. + */ + @java.lang.Override + public boolean getDedicatedEndpointEnabled() { + return dedicatedEndpointEnabled_; + } + /** + * + * + *
+     * If true, the endpoint will be exposed through a dedicated
+     * DNS [Endpoint.dedicated_endpoint_dns]. Your request to the dedicated DNS
+     * will be isolated from other users' traffic and will have better performance
+     * and reliability.
+     * Note: Once you enabled dedicated endpoint, you won't be able to send
+     * request to the shared DNS {region}-aiplatform.googleapis.com. The
+     * limitation will be removed soon.
+     * 
+ * + * bool dedicated_endpoint_enabled = 24; + * + * @param value The dedicatedEndpointEnabled to set. + * @return This builder for chaining. + */ + public Builder setDedicatedEndpointEnabled(boolean value) { + + dedicatedEndpointEnabled_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * If true, the endpoint will be exposed through a dedicated
+     * DNS [Endpoint.dedicated_endpoint_dns]. Your request to the dedicated DNS
+     * will be isolated from other users' traffic and will have better performance
+     * and reliability.
+     * Note: Once you enabled dedicated endpoint, you won't be able to send
+     * request to the shared DNS {region}-aiplatform.googleapis.com. The
+     * limitation will be removed soon.
+     * 
+ * + * bool dedicated_endpoint_enabled = 24; + * + * @return This builder for chaining. + */ + public Builder clearDedicatedEndpointEnabled() { + bitField0_ = (bitField0_ & ~0x00008000); + dedicatedEndpointEnabled_ = false; + onChanged(); + return this; + } + + private java.lang.Object dedicatedEndpointDns_ = ""; + /** + * + * + *
+     * Output only. DNS of the dedicated endpoint. Will only be populated if
+     * dedicated_endpoint_enabled is true.
+     * Format:
+     * `https://{endpoint_id}.{region}-{project_number}.prediction.vertexai.goog`.
+     * 
+ * + * string dedicated_endpoint_dns = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dedicatedEndpointDns. + */ + public java.lang.String getDedicatedEndpointDns() { + java.lang.Object ref = dedicatedEndpointDns_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dedicatedEndpointDns_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. DNS of the dedicated endpoint. Will only be populated if
+     * dedicated_endpoint_enabled is true.
+     * Format:
+     * `https://{endpoint_id}.{region}-{project_number}.prediction.vertexai.goog`.
+     * 
+ * + * string dedicated_endpoint_dns = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dedicatedEndpointDns. + */ + public com.google.protobuf.ByteString getDedicatedEndpointDnsBytes() { + java.lang.Object ref = dedicatedEndpointDns_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dedicatedEndpointDns_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. DNS of the dedicated endpoint. Will only be populated if
+     * dedicated_endpoint_enabled is true.
+     * Format:
+     * `https://{endpoint_id}.{region}-{project_number}.prediction.vertexai.goog`.
+     * 
+ * + * string dedicated_endpoint_dns = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The dedicatedEndpointDns to set. + * @return This builder for chaining. + */ + public Builder setDedicatedEndpointDns(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dedicatedEndpointDns_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. DNS of the dedicated endpoint. Will only be populated if
+     * dedicated_endpoint_enabled is true.
+     * Format:
+     * `https://{endpoint_id}.{region}-{project_number}.prediction.vertexai.goog`.
+     * 
+ * + * string dedicated_endpoint_dns = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDedicatedEndpointDns() { + dedicatedEndpointDns_ = getDefaultInstance().getDedicatedEndpointDns(); + bitField0_ = (bitField0_ & ~0x00010000); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. DNS of the dedicated endpoint. Will only be populated if
+     * dedicated_endpoint_enabled is true.
+     * Format:
+     * `https://{endpoint_id}.{region}-{project_number}.prediction.vertexai.goog`.
+     * 
+ * + * string dedicated_endpoint_dns = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for dedicatedEndpointDns to set. + * @return This builder for chaining. + */ + public Builder setDedicatedEndpointDnsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dedicatedEndpointDns_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + private boolean satisfiesPzs_; + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public boolean getSatisfiesPzs() { + return satisfiesPzs_; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The satisfiesPzs to set. + * @return This builder for chaining. + */ + public Builder setSatisfiesPzs(boolean value) { + + satisfiesPzs_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSatisfiesPzs() { + bitField0_ = (bitField0_ & ~0x00020000); + satisfiesPzs_ = false; + onChanged(); + return this; + } + + private boolean satisfiesPzi_; + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * bool satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The satisfiesPzi. + */ + @java.lang.Override + public boolean getSatisfiesPzi() { + return satisfiesPzi_; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * bool satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The satisfiesPzi to set. + * @return This builder for chaining. + */ + public Builder setSatisfiesPzi(boolean value) { + + satisfiesPzi_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reserved for future use.
+     * 
+ * + * bool satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSatisfiesPzi() { + bitField0_ = (bitField0_ & ~0x00040000); + satisfiesPzi_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/EndpointOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/EndpointOrBuilder.java index 763284448406..a3d0b9b24c67 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/EndpointOrBuilder.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/EndpointOrBuilder.java @@ -724,4 +724,80 @@ java.lang.String getLabelsOrDefault( */ com.google.cloud.vertexai.api.PredictRequestResponseLoggingConfigOrBuilder getPredictRequestResponseLoggingConfigOrBuilder(); + + /** + * + * + *
+   * If true, the endpoint will be exposed through a dedicated
+   * DNS [Endpoint.dedicated_endpoint_dns]. Your request to the dedicated DNS
+   * will be isolated from other users' traffic and will have better performance
+   * and reliability.
+   * Note: Once you enabled dedicated endpoint, you won't be able to send
+   * request to the shared DNS {region}-aiplatform.googleapis.com. The
+   * limitation will be removed soon.
+   * 
+ * + * bool dedicated_endpoint_enabled = 24; + * + * @return The dedicatedEndpointEnabled. + */ + boolean getDedicatedEndpointEnabled(); + + /** + * + * + *
+   * Output only. DNS of the dedicated endpoint. Will only be populated if
+   * dedicated_endpoint_enabled is true.
+   * Format:
+   * `https://{endpoint_id}.{region}-{project_number}.prediction.vertexai.goog`.
+   * 
+ * + * string dedicated_endpoint_dns = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dedicatedEndpointDns. + */ + java.lang.String getDedicatedEndpointDns(); + /** + * + * + *
+   * Output only. DNS of the dedicated endpoint. Will only be populated if
+   * dedicated_endpoint_enabled is true.
+   * Format:
+   * `https://{endpoint_id}.{region}-{project_number}.prediction.vertexai.goog`.
+   * 
+ * + * string dedicated_endpoint_dns = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for dedicatedEndpointDns. + */ + com.google.protobuf.ByteString getDedicatedEndpointDnsBytes(); + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The satisfiesPzs. + */ + boolean getSatisfiesPzs(); + + /** + * + * + *
+   * Output only. Reserved for future use.
+   * 
+ * + * bool satisfies_pzi = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The satisfiesPzi. + */ + boolean getSatisfiesPzi(); } diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/EndpointProto.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/EndpointProto.java index a60107e1cef6..bac2b6b7da6b 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/EndpointProto.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/EndpointProto.java @@ -70,7 +70,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ai/v1/io.proto\0320google/cloud/vertexai/v1" + "/machine_resources.proto\0321google/cloud/v" + "ertexai/v1/service_networking.proto\032\037goo" - + "gle/protobuf/timestamp.proto\"\234\t\n\010Endpoin" + + "gle/protobuf/timestamp.proto\"\235\n\n\010Endpoin" + "t\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\031\n\014display_name\030\002 \001" + "(\tB\003\340A\002\022\023\n\013description\030\003 \001(\t\022E\n\017deployed" + "_models\030\004 \003(\0132\'.google.cloud.vertexai.v1" @@ -93,45 +93,48 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ntMonitoringJob\022n\n\'predict_request_respo" + "nse_logging_config\030\022 \001(\0132=.google.cloud." + "vertexai.v1.PredictRequestResponseLoggin" - + "gConfig\0323\n\021TrafficSplitEntry\022\013\n\003key\030\001 \001(" - + "\t\022\r\n\005value\030\002 \001(\005:\0028\001\032-\n\013LabelsEntry\022\013\n\003k" - + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\265\001\352A\261\001\n\"aipl" - + "atform.googleapis.com/Endpoint\022cloud.google.com/go/aiplatfo" - + "rm/apiv1/aiplatformpb;aiplatformpb\252\002\032Goo" - + "gle.Cloud.AIPlatform.V1\312\002\032Google\\Cloud\\A" - + "IPlatform\\V1\352\002\035Google::Cloud::AIPlatform" - + "::V1b\006proto3" + + "gConfig\022\"\n\032dedicated_endpoint_enabled\030\030 " + + "\001(\010\022#\n\026dedicated_endpoint_dns\030\031 \001(\tB\003\340A\003" + + "\022\032\n\rsatisfies_pzs\030\033 \001(\010B\003\340A\003\022\032\n\rsatisfie" + + "s_pzi\030\034 \001(\010B\003\340A\003\0323\n\021TrafficSplitEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\005:\0028\001\032-\n\013LabelsE" + + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\265\001\352" + + "A\261\001\n\"aiplatform.googleapis.com/Endpoint\022" + + "cloud.google.com/go" + + "/aiplatform/apiv1/aiplatformpb;aiplatfor" + + "mpb\252\002\032Google.Cloud.AIPlatform.V1\312\002\032Googl" + + "e\\Cloud\\AIPlatform\\V1\352\002\035Google::Cloud::A" + + "IPlatform::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -167,6 +170,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PrivateServiceConnectConfig", "ModelDeploymentMonitoringJob", "PredictRequestResponseLoggingConfig", + "DedicatedEndpointEnabled", + "DedicatedEndpointDns", + "SatisfiesPzs", + "SatisfiesPzi", }); internal_static_google_cloud_vertexai_v1_Endpoint_TrafficSplitEntry_descriptor = internal_static_google_cloud_vertexai_v1_Endpoint_descriptor.getNestedTypes().get(0); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/FunctionCallingConfig.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/FunctionCallingConfig.java index 6973ecc76460..08dfba25a28c 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/FunctionCallingConfig.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/FunctionCallingConfig.java @@ -89,7 +89,7 @@ public enum Mode implements com.google.protobuf.ProtocolMessageEnum { * *
      * Default model behavior, model decides to predict either a function call
-     * or a natural language repspose.
+     * or a natural language response.
      * 
* * AUTO = 1; @@ -137,7 +137,7 @@ public enum Mode implements com.google.protobuf.ProtocolMessageEnum { * *
      * Default model behavior, model decides to predict either a function call
-     * or a natural language repspose.
+     * or a natural language response.
      * 
* * AUTO = 1; diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequest.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequest.java index 514185eca21e..2a21f527ced9 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequest.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequest.java @@ -75,9 +75,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The name of the publisher model requested to serve the
-   * prediction. Format:
+   * Required. The fully qualified name of the publisher model or tuned model
+   * endpoint to use.
+   *
+   * Publisher model format:
    * `projects/{project}/locations/{location}/publishers/*/models/*`
+   *
+   * Tuned model endpoint format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
    * 
* * string model = 5 [(.google.api.field_behavior) = REQUIRED]; @@ -100,9 +105,14 @@ public java.lang.String getModel() { * * *
-   * Required. The name of the publisher model requested to serve the
-   * prediction. Format:
+   * Required. The fully qualified name of the publisher model or tuned model
+   * endpoint to use.
+   *
+   * Publisher model format:
    * `projects/{project}/locations/{location}/publishers/*/models/*`
+   *
+   * Tuned model endpoint format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
    * 
* * string model = 5 [(.google.api.field_behavior) = REQUIRED]; @@ -1264,9 +1274,14 @@ public Builder mergeFrom( * * *
-     * Required. The name of the publisher model requested to serve the
-     * prediction. Format:
+     * Required. The fully qualified name of the publisher model or tuned model
+     * endpoint to use.
+     *
+     * Publisher model format:
      * `projects/{project}/locations/{location}/publishers/*/models/*`
+     *
+     * Tuned model endpoint format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
      * 
* * string model = 5 [(.google.api.field_behavior) = REQUIRED]; @@ -1288,9 +1303,14 @@ public java.lang.String getModel() { * * *
-     * Required. The name of the publisher model requested to serve the
-     * prediction. Format:
+     * Required. The fully qualified name of the publisher model or tuned model
+     * endpoint to use.
+     *
+     * Publisher model format:
      * `projects/{project}/locations/{location}/publishers/*/models/*`
+     *
+     * Tuned model endpoint format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
      * 
* * string model = 5 [(.google.api.field_behavior) = REQUIRED]; @@ -1312,9 +1332,14 @@ public com.google.protobuf.ByteString getModelBytes() { * * *
-     * Required. The name of the publisher model requested to serve the
-     * prediction. Format:
+     * Required. The fully qualified name of the publisher model or tuned model
+     * endpoint to use.
+     *
+     * Publisher model format:
      * `projects/{project}/locations/{location}/publishers/*/models/*`
+     *
+     * Tuned model endpoint format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
      * 
* * string model = 5 [(.google.api.field_behavior) = REQUIRED]; @@ -1335,9 +1360,14 @@ public Builder setModel(java.lang.String value) { * * *
-     * Required. The name of the publisher model requested to serve the
-     * prediction. Format:
+     * Required. The fully qualified name of the publisher model or tuned model
+     * endpoint to use.
+     *
+     * Publisher model format:
      * `projects/{project}/locations/{location}/publishers/*/models/*`
+     *
+     * Tuned model endpoint format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
      * 
* * string model = 5 [(.google.api.field_behavior) = REQUIRED]; @@ -1354,9 +1384,14 @@ public Builder clearModel() { * * *
-     * Required. The name of the publisher model requested to serve the
-     * prediction. Format:
+     * Required. The fully qualified name of the publisher model or tuned model
+     * endpoint to use.
+     *
+     * Publisher model format:
      * `projects/{project}/locations/{location}/publishers/*/models/*`
+     *
+     * Tuned model endpoint format:
+     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
      * 
* * string model = 5 [(.google.api.field_behavior) = REQUIRED]; diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequestOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequestOrBuilder.java index a4834cdc8088..b95fc267161c 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequestOrBuilder.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerateContentRequestOrBuilder.java @@ -28,9 +28,14 @@ public interface GenerateContentRequestOrBuilder * * *
-   * Required. The name of the publisher model requested to serve the
-   * prediction. Format:
+   * Required. The fully qualified name of the publisher model or tuned model
+   * endpoint to use.
+   *
+   * Publisher model format:
    * `projects/{project}/locations/{location}/publishers/*/models/*`
+   *
+   * Tuned model endpoint format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
    * 
* * string model = 5 [(.google.api.field_behavior) = REQUIRED]; @@ -42,9 +47,14 @@ public interface GenerateContentRequestOrBuilder * * *
-   * Required. The name of the publisher model requested to serve the
-   * prediction. Format:
+   * Required. The fully qualified name of the publisher model or tuned model
+   * endpoint to use.
+   *
+   * Publisher model format:
    * `projects/{project}/locations/{location}/publishers/*/models/*`
+   *
+   * Tuned model endpoint format:
+   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
    * 
* * string model = 5 [(.google.api.field_behavior) = REQUIRED]; diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerateContentResponse.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerateContentResponse.java index 4891f7c37bec..388b4fafc436 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerateContentResponse.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerateContentResponse.java @@ -1752,7 +1752,9 @@ public interface UsageMetadataOrBuilder * * *
-     * Number of tokens in the request.
+     * Number of tokens in the request. When `cached_content` is set, this is
+     * still the total effective prompt size meaning this includes the number of
+     * tokens in the cached content.
      * 
* * int32 prompt_token_count = 1; @@ -1829,7 +1831,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-     * Number of tokens in the request.
+     * Number of tokens in the request. When `cached_content` is set, this is
+     * still the total effective prompt size meaning this includes the number of
+     * tokens in the cached content.
      * 
* * int32 prompt_token_count = 1; @@ -2273,7 +2277,9 @@ public Builder mergeFrom( * * *
-       * Number of tokens in the request.
+       * Number of tokens in the request. When `cached_content` is set, this is
+       * still the total effective prompt size meaning this includes the number of
+       * tokens in the cached content.
        * 
* * int32 prompt_token_count = 1; @@ -2288,7 +2294,9 @@ public int getPromptTokenCount() { * * *
-       * Number of tokens in the request.
+       * Number of tokens in the request. When `cached_content` is set, this is
+       * still the total effective prompt size meaning this includes the number of
+       * tokens in the cached content.
        * 
* * int32 prompt_token_count = 1; @@ -2307,7 +2315,9 @@ public Builder setPromptTokenCount(int value) { * * *
-       * Number of tokens in the request.
+       * Number of tokens in the request. When `cached_content` is set, this is
+       * still the total effective prompt size meaning this includes the number of
+       * tokens in the cached content.
        * 
* * int32 prompt_token_count = 1; diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerationConfig.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerationConfig.java index 5f6a4814fcab..3c884bcd0ce0 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerationConfig.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerationConfig.java @@ -64,6 +64,2982 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.vertexai.api.GenerationConfig.Builder.class); } + public interface RoutingConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Automated routing.
+     * 
+ * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + * + * @return Whether the autoMode field is set. + */ + boolean hasAutoMode(); + /** + * + * + *
+     * Automated routing.
+     * 
+ * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + * + * @return The autoMode. + */ + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode getAutoMode(); + /** + * + * + *
+     * Automated routing.
+     * 
+ * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + */ + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingModeOrBuilder + getAutoModeOrBuilder(); + + /** + * + * + *
+     * Manual routing.
+     * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + * + * @return Whether the manualMode field is set. + */ + boolean hasManualMode(); + /** + * + * + *
+     * Manual routing.
+     * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + * + * @return The manualMode. + */ + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode getManualMode(); + /** + * + * + *
+     * Manual routing.
+     * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + */ + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingModeOrBuilder + getManualModeOrBuilder(); + + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.RoutingConfigCase + getRoutingConfigCase(); + } + /** + * + * + *
+   * The configuration for routing the request to a specific model.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.GenerationConfig.RoutingConfig} + */ + public static final class RoutingConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig) + RoutingConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use RoutingConfig.newBuilder() to construct. + private RoutingConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RoutingConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RoutingConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.class, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.Builder.class); + } + + public interface AutoRoutingModeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The model routing preference.
+       * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference model_routing_preference = 1; + * + * + * @return Whether the modelRoutingPreference field is set. + */ + boolean hasModelRoutingPreference(); + /** + * + * + *
+       * The model routing preference.
+       * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference model_routing_preference = 1; + * + * + * @return The enum numeric value on the wire for modelRoutingPreference. + */ + int getModelRoutingPreferenceValue(); + /** + * + * + *
+       * The model routing preference.
+       * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference model_routing_preference = 1; + * + * + * @return The modelRoutingPreference. + */ + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .ModelRoutingPreference + getModelRoutingPreference(); + } + /** + * + * + *
+     * When automated routing is specified, the routing will be determined by
+     * the pretrained routing model and customer provided model routing
+     * preference.
+     * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode} + */ + public static final class AutoRoutingMode extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode) + AutoRoutingModeOrBuilder { + private static final long serialVersionUID = 0L; + // Use AutoRoutingMode.newBuilder() to construct. + private AutoRoutingMode(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AutoRoutingMode() { + modelRoutingPreference_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AutoRoutingMode(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_AutoRoutingMode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_AutoRoutingMode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode.class, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode.Builder + .class); + } + + /** + * + * + *
+       * The model routing preference.
+       * 
+ * + * Protobuf enum {@code + * google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference} + */ + public enum ModelRoutingPreference implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+         * Unspecified model routing preference.
+         * 
+ * + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + * + * + *
+         * Prefer higher quality over low cost.
+         * 
+ * + * PRIORITIZE_QUALITY = 1; + */ + PRIORITIZE_QUALITY(1), + /** + * + * + *
+         * Balanced model routing preference.
+         * 
+ * + * BALANCED = 2; + */ + BALANCED(2), + /** + * + * + *
+         * Prefer lower cost over higher quality.
+         * 
+ * + * PRIORITIZE_COST = 3; + */ + PRIORITIZE_COST(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+         * Unspecified model routing preference.
+         * 
+ * + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + * + * + *
+         * Prefer higher quality over low cost.
+         * 
+ * + * PRIORITIZE_QUALITY = 1; + */ + public static final int PRIORITIZE_QUALITY_VALUE = 1; + /** + * + * + *
+         * Balanced model routing preference.
+         * 
+ * + * BALANCED = 2; + */ + public static final int BALANCED_VALUE = 2; + /** + * + * + *
+         * Prefer lower cost over higher quality.
+         * 
+ * + * PRIORITIZE_COST = 3; + */ + public static final int PRIORITIZE_COST_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ModelRoutingPreference valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ModelRoutingPreference forNumber(int value) { + switch (value) { + case 0: + return UNKNOWN; + case 1: + return PRIORITIZE_QUALITY; + case 2: + return BALANCED; + case 3: + return PRIORITIZE_COST; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ModelRoutingPreference findValueByNumber(int number) { + return ModelRoutingPreference.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ModelRoutingPreference[] VALUES = values(); + + public static ModelRoutingPreference valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ModelRoutingPreference(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference) + } + + private int bitField0_; + public static final int MODEL_ROUTING_PREFERENCE_FIELD_NUMBER = 1; + private int modelRoutingPreference_ = 0; + /** + * + * + *
+       * The model routing preference.
+       * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference model_routing_preference = 1; + * + * + * @return Whether the modelRoutingPreference field is set. + */ + @java.lang.Override + public boolean hasModelRoutingPreference() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * The model routing preference.
+       * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference model_routing_preference = 1; + * + * + * @return The enum numeric value on the wire for modelRoutingPreference. + */ + @java.lang.Override + public int getModelRoutingPreferenceValue() { + return modelRoutingPreference_; + } + /** + * + * + *
+       * The model routing preference.
+       * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference model_routing_preference = 1; + * + * + * @return The modelRoutingPreference. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .ModelRoutingPreference + getModelRoutingPreference() { + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .ModelRoutingPreference + result = + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .ModelRoutingPreference.forNumber(modelRoutingPreference_); + return result == null + ? com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .ModelRoutingPreference.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeEnum(1, modelRoutingPreference_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, modelRoutingPreference_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode other = + (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode) obj; + + if (hasModelRoutingPreference() != other.hasModelRoutingPreference()) return false; + if (hasModelRoutingPreference()) { + if (modelRoutingPreference_ != other.modelRoutingPreference_) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasModelRoutingPreference()) { + hash = (37 * hash) + MODEL_ROUTING_PREFERENCE_FIELD_NUMBER; + hash = (53 * hash) + modelRoutingPreference_; + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * When automated routing is specified, the routing will be determined by
+       * the pretrained routing model and customer provided model routing
+       * preference.
+       * 
+ * + * Protobuf type {@code + * google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode) + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingModeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_AutoRoutingMode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_AutoRoutingMode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .class, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .Builder.class); + } + + // Construct using + // com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + modelRoutingPreference_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_AutoRoutingMode_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + build() { + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + buildPartial() { + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode result = + new com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.modelRoutingPreference_ = modelRoutingPreference_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode) { + return mergeFrom( + (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode other) { + if (other + == com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .getDefaultInstance()) return this; + if (other.hasModelRoutingPreference()) { + setModelRoutingPreference(other.getModelRoutingPreference()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + modelRoutingPreference_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int modelRoutingPreference_ = 0; + /** + * + * + *
+         * The model routing preference.
+         * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference model_routing_preference = 1; + * + * + * @return Whether the modelRoutingPreference field is set. + */ + @java.lang.Override + public boolean hasModelRoutingPreference() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+         * The model routing preference.
+         * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference model_routing_preference = 1; + * + * + * @return The enum numeric value on the wire for modelRoutingPreference. + */ + @java.lang.Override + public int getModelRoutingPreferenceValue() { + return modelRoutingPreference_; + } + /** + * + * + *
+         * The model routing preference.
+         * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference model_routing_preference = 1; + * + * + * @param value The enum numeric value on the wire for modelRoutingPreference to set. + * @return This builder for chaining. + */ + public Builder setModelRoutingPreferenceValue(int value) { + modelRoutingPreference_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The model routing preference.
+         * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference model_routing_preference = 1; + * + * + * @return The modelRoutingPreference. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .ModelRoutingPreference + getModelRoutingPreference() { + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .ModelRoutingPreference + result = + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .ModelRoutingPreference.forNumber(modelRoutingPreference_); + return result == null + ? com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .ModelRoutingPreference.UNRECOGNIZED + : result; + } + /** + * + * + *
+         * The model routing preference.
+         * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference model_routing_preference = 1; + * + * + * @param value The modelRoutingPreference to set. + * @return This builder for chaining. + */ + public Builder setModelRoutingPreference( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .ModelRoutingPreference + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + modelRoutingPreference_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * The model routing preference.
+         * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference model_routing_preference = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearModelRoutingPreference() { + bitField0_ = (bitField0_ & ~0x00000001); + modelRoutingPreference_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode) + private static final com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig + .AutoRoutingMode + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode(); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutoRoutingMode parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ManualRoutingModeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The model name to use. Only the public LLM models are accepted. e.g.
+       * 'gemini-1.5-pro-001'.
+       * 
+ * + * optional string model_name = 1; + * + * @return Whether the modelName field is set. + */ + boolean hasModelName(); + /** + * + * + *
+       * The model name to use. Only the public LLM models are accepted. e.g.
+       * 'gemini-1.5-pro-001'.
+       * 
+ * + * optional string model_name = 1; + * + * @return The modelName. + */ + java.lang.String getModelName(); + /** + * + * + *
+       * The model name to use. Only the public LLM models are accepted. e.g.
+       * 'gemini-1.5-pro-001'.
+       * 
+ * + * optional string model_name = 1; + * + * @return The bytes for modelName. + */ + com.google.protobuf.ByteString getModelNameBytes(); + } + /** + * + * + *
+     * When manual routing is set, the specified model will be used directly.
+     * 
+ * + * Protobuf type {@code + * google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode} + */ + public static final class ManualRoutingMode extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode) + ManualRoutingModeOrBuilder { + private static final long serialVersionUID = 0L; + // Use ManualRoutingMode.newBuilder() to construct. + private ManualRoutingMode(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ManualRoutingMode() { + modelName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ManualRoutingMode(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_ManualRoutingMode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_ManualRoutingMode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .class, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .Builder.class); + } + + private int bitField0_; + public static final int MODEL_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object modelName_ = ""; + /** + * + * + *
+       * The model name to use. Only the public LLM models are accepted. e.g.
+       * 'gemini-1.5-pro-001'.
+       * 
+ * + * optional string model_name = 1; + * + * @return Whether the modelName field is set. + */ + @java.lang.Override + public boolean hasModelName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * The model name to use. Only the public LLM models are accepted. e.g.
+       * 'gemini-1.5-pro-001'.
+       * 
+ * + * optional string model_name = 1; + * + * @return The modelName. + */ + @java.lang.Override + public java.lang.String getModelName() { + java.lang.Object ref = modelName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelName_ = s; + return s; + } + } + /** + * + * + *
+       * The model name to use. Only the public LLM models are accepted. e.g.
+       * 'gemini-1.5-pro-001'.
+       * 
+ * + * optional string model_name = 1; + * + * @return The bytes for modelName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelNameBytes() { + java.lang.Object ref = modelName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, modelName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, modelName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode other = + (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode) obj; + + if (hasModelName() != other.hasModelName()) return false; + if (hasModelName()) { + if (!getModelName().equals(other.getModelName())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasModelName()) { + hash = (37 * hash) + MODEL_NAME_FIELD_NUMBER; + hash = (53 * hash) + getModelName().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * When manual routing is set, the specified model will be used directly.
+       * 
+ * + * Protobuf type {@code + * google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode) + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingModeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_ManualRoutingMode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_ManualRoutingMode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .class, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .Builder.class); + } + + // Construct using + // com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + modelName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_ManualRoutingMode_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + build() { + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + buildPartial() { + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode result = + new com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.modelName_ = modelName_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode) { + return mergeFrom( + (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode other) { + if (other + == com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .getDefaultInstance()) return this; + if (other.hasModelName()) { + modelName_ = other.modelName_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + modelName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object modelName_ = ""; + /** + * + * + *
+         * The model name to use. Only the public LLM models are accepted. e.g.
+         * 'gemini-1.5-pro-001'.
+         * 
+ * + * optional string model_name = 1; + * + * @return Whether the modelName field is set. + */ + public boolean hasModelName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+         * The model name to use. Only the public LLM models are accepted. e.g.
+         * 'gemini-1.5-pro-001'.
+         * 
+ * + * optional string model_name = 1; + * + * @return The modelName. + */ + public java.lang.String getModelName() { + java.lang.Object ref = modelName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + modelName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The model name to use. Only the public LLM models are accepted. e.g.
+         * 'gemini-1.5-pro-001'.
+         * 
+ * + * optional string model_name = 1; + * + * @return The bytes for modelName. + */ + public com.google.protobuf.ByteString getModelNameBytes() { + java.lang.Object ref = modelName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + modelName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The model name to use. Only the public LLM models are accepted. e.g.
+         * 'gemini-1.5-pro-001'.
+         * 
+ * + * optional string model_name = 1; + * + * @param value The modelName to set. + * @return This builder for chaining. + */ + public Builder setModelName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + modelName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The model name to use. Only the public LLM models are accepted. e.g.
+         * 'gemini-1.5-pro-001'.
+         * 
+ * + * optional string model_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearModelName() { + modelName_ = getDefaultInstance().getModelName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * The model name to use. Only the public LLM models are accepted. e.g.
+         * 'gemini-1.5-pro-001'.
+         * 
+ * + * optional string model_name = 1; + * + * @param value The bytes for modelName to set. + * @return This builder for chaining. + */ + public Builder setModelNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + modelName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode) + private static final com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig + .ManualRoutingMode + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode(); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ManualRoutingMode parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int routingConfigCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object routingConfig_; + + public enum RoutingConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AUTO_MODE(1), + MANUAL_MODE(2), + ROUTINGCONFIG_NOT_SET(0); + private final int value; + + private RoutingConfigCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RoutingConfigCase valueOf(int value) { + return forNumber(value); + } + + public static RoutingConfigCase forNumber(int value) { + switch (value) { + case 1: + return AUTO_MODE; + case 2: + return MANUAL_MODE; + case 0: + return ROUTINGCONFIG_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RoutingConfigCase getRoutingConfigCase() { + return RoutingConfigCase.forNumber(routingConfigCase_); + } + + public static final int AUTO_MODE_FIELD_NUMBER = 1; + /** + * + * + *
+     * Automated routing.
+     * 
+ * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + * + * @return Whether the autoMode field is set. + */ + @java.lang.Override + public boolean hasAutoMode() { + return routingConfigCase_ == 1; + } + /** + * + * + *
+     * Automated routing.
+     * 
+ * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + * + * @return The autoMode. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + getAutoMode() { + if (routingConfigCase_ == 1) { + return (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode) + routingConfig_; + } + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .getDefaultInstance(); + } + /** + * + * + *
+     * Automated routing.
+     * 
+ * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingModeOrBuilder + getAutoModeOrBuilder() { + if (routingConfigCase_ == 1) { + return (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode) + routingConfig_; + } + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .getDefaultInstance(); + } + + public static final int MANUAL_MODE_FIELD_NUMBER = 2; + /** + * + * + *
+     * Manual routing.
+     * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + * + * @return Whether the manualMode field is set. + */ + @java.lang.Override + public boolean hasManualMode() { + return routingConfigCase_ == 2; + } + /** + * + * + *
+     * Manual routing.
+     * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + * + * @return The manualMode. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + getManualMode() { + if (routingConfigCase_ == 2) { + return (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode) + routingConfig_; + } + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .getDefaultInstance(); + } + /** + * + * + *
+     * Manual routing.
+     * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingModeOrBuilder + getManualModeOrBuilder() { + if (routingConfigCase_ == 2) { + return (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode) + routingConfig_; + } + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (routingConfigCase_ == 1) { + output.writeMessage( + 1, + (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode) + routingConfig_); + } + if (routingConfigCase_ == 2) { + output.writeMessage( + 2, + (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode) + routingConfig_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (routingConfigCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, + (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode) + routingConfig_); + } + if (routingConfigCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, + (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode) + routingConfig_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig other = + (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig) obj; + + if (!getRoutingConfigCase().equals(other.getRoutingConfigCase())) return false; + switch (routingConfigCase_) { + case 1: + if (!getAutoMode().equals(other.getAutoMode())) return false; + break; + case 2: + if (!getManualMode().equals(other.getManualMode())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (routingConfigCase_) { + case 1: + hash = (37 * hash) + AUTO_MODE_FIELD_NUMBER; + hash = (53 * hash) + getAutoMode().hashCode(); + break; + case 2: + hash = (37 * hash) + MANUAL_MODE_FIELD_NUMBER; + hash = (53 * hash) + getManualMode().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The configuration for routing the request to a specific model.
+     * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.GenerationConfig.RoutingConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig) + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.class, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (autoModeBuilder_ != null) { + autoModeBuilder_.clear(); + } + if (manualModeBuilder_ != null) { + manualModeBuilder_.clear(); + } + routingConfigCase_ = 0; + routingConfig_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GenerationConfig_RoutingConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig build() { + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig buildPartial() { + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig result = + new com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig result) { + result.routingConfigCase_ = routingConfigCase_; + result.routingConfig_ = this.routingConfig_; + if (routingConfigCase_ == 1 && autoModeBuilder_ != null) { + result.routingConfig_ = autoModeBuilder_.build(); + } + if (routingConfigCase_ == 2 && manualModeBuilder_ != null) { + result.routingConfig_ = manualModeBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig) { + return mergeFrom((com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig other) { + if (other + == com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.getDefaultInstance()) + return this; + switch (other.getRoutingConfigCase()) { + case AUTO_MODE: + { + mergeAutoMode(other.getAutoMode()); + break; + } + case MANUAL_MODE: + { + mergeManualMode(other.getManualMode()); + break; + } + case ROUTINGCONFIG_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getAutoModeFieldBuilder().getBuilder(), extensionRegistry); + routingConfigCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getManualModeFieldBuilder().getBuilder(), extensionRegistry); + routingConfigCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int routingConfigCase_ = 0; + private java.lang.Object routingConfig_; + + public RoutingConfigCase getRoutingConfigCase() { + return RoutingConfigCase.forNumber(routingConfigCase_); + } + + public Builder clearRoutingConfig() { + routingConfigCase_ = 0; + routingConfig_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode.Builder, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingModeOrBuilder> + autoModeBuilder_; + /** + * + * + *
+       * Automated routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + * + * @return Whether the autoMode field is set. + */ + @java.lang.Override + public boolean hasAutoMode() { + return routingConfigCase_ == 1; + } + /** + * + * + *
+       * Automated routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + * + * @return The autoMode. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + getAutoMode() { + if (autoModeBuilder_ == null) { + if (routingConfigCase_ == 1) { + return (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode) + routingConfig_; + } + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .getDefaultInstance(); + } else { + if (routingConfigCase_ == 1) { + return autoModeBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Automated routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + */ + public Builder setAutoMode( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode value) { + if (autoModeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routingConfig_ = value; + onChanged(); + } else { + autoModeBuilder_.setMessage(value); + } + routingConfigCase_ = 1; + return this; + } + /** + * + * + *
+       * Automated routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + */ + public Builder setAutoMode( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode.Builder + builderForValue) { + if (autoModeBuilder_ == null) { + routingConfig_ = builderForValue.build(); + onChanged(); + } else { + autoModeBuilder_.setMessage(builderForValue.build()); + } + routingConfigCase_ = 1; + return this; + } + /** + * + * + *
+       * Automated routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + */ + public Builder mergeAutoMode( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode value) { + if (autoModeBuilder_ == null) { + if (routingConfigCase_ == 1 + && routingConfig_ + != com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .getDefaultInstance()) { + routingConfig_ = + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .newBuilder( + (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig + .AutoRoutingMode) + routingConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + routingConfig_ = value; + } + onChanged(); + } else { + if (routingConfigCase_ == 1) { + autoModeBuilder_.mergeFrom(value); + } else { + autoModeBuilder_.setMessage(value); + } + } + routingConfigCase_ = 1; + return this; + } + /** + * + * + *
+       * Automated routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + */ + public Builder clearAutoMode() { + if (autoModeBuilder_ == null) { + if (routingConfigCase_ == 1) { + routingConfigCase_ = 0; + routingConfig_ = null; + onChanged(); + } + } else { + if (routingConfigCase_ == 1) { + routingConfigCase_ = 0; + routingConfig_ = null; + } + autoModeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Automated routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + */ + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode.Builder + getAutoModeBuilder() { + return getAutoModeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Automated routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingModeOrBuilder + getAutoModeOrBuilder() { + if ((routingConfigCase_ == 1) && (autoModeBuilder_ != null)) { + return autoModeBuilder_.getMessageOrBuilder(); + } else { + if (routingConfigCase_ == 1) { + return (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode) + routingConfig_; + } + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Automated routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.AutoRoutingMode auto_mode = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode.Builder, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingModeOrBuilder> + getAutoModeFieldBuilder() { + if (autoModeBuilder_ == null) { + if (!(routingConfigCase_ == 1)) { + routingConfig_ = + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .getDefaultInstance(); + } + autoModeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode + .Builder, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig + .AutoRoutingModeOrBuilder>( + (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.AutoRoutingMode) + routingConfig_, + getParentForChildren(), + isClean()); + routingConfig_ = null; + } + routingConfigCase_ = 1; + onChanged(); + return autoModeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .Builder, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig + .ManualRoutingModeOrBuilder> + manualModeBuilder_; + /** + * + * + *
+       * Manual routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + * + * @return Whether the manualMode field is set. + */ + @java.lang.Override + public boolean hasManualMode() { + return routingConfigCase_ == 2; + } + /** + * + * + *
+       * Manual routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + * + * @return The manualMode. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + getManualMode() { + if (manualModeBuilder_ == null) { + if (routingConfigCase_ == 2) { + return (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode) + routingConfig_; + } + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .getDefaultInstance(); + } else { + if (routingConfigCase_ == 2) { + return manualModeBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Manual routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + */ + public Builder setManualMode( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode value) { + if (manualModeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routingConfig_ = value; + onChanged(); + } else { + manualModeBuilder_.setMessage(value); + } + routingConfigCase_ = 2; + return this; + } + /** + * + * + *
+       * Manual routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + */ + public Builder setManualMode( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode.Builder + builderForValue) { + if (manualModeBuilder_ == null) { + routingConfig_ = builderForValue.build(); + onChanged(); + } else { + manualModeBuilder_.setMessage(builderForValue.build()); + } + routingConfigCase_ = 2; + return this; + } + /** + * + * + *
+       * Manual routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + */ + public Builder mergeManualMode( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode value) { + if (manualModeBuilder_ == null) { + if (routingConfigCase_ == 2 + && routingConfig_ + != com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .getDefaultInstance()) { + routingConfig_ = + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .newBuilder( + (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig + .ManualRoutingMode) + routingConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + routingConfig_ = value; + } + onChanged(); + } else { + if (routingConfigCase_ == 2) { + manualModeBuilder_.mergeFrom(value); + } else { + manualModeBuilder_.setMessage(value); + } + } + routingConfigCase_ = 2; + return this; + } + /** + * + * + *
+       * Manual routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + */ + public Builder clearManualMode() { + if (manualModeBuilder_ == null) { + if (routingConfigCase_ == 2) { + routingConfigCase_ = 0; + routingConfig_ = null; + onChanged(); + } + } else { + if (routingConfigCase_ == 2) { + routingConfigCase_ = 0; + routingConfig_ = null; + } + manualModeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Manual routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + */ + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode.Builder + getManualModeBuilder() { + return getManualModeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Manual routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingModeOrBuilder + getManualModeOrBuilder() { + if ((routingConfigCase_ == 2) && (manualModeBuilder_ != null)) { + return manualModeBuilder_.getMessageOrBuilder(); + } else { + if (routingConfigCase_ == 2) { + return (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode) + routingConfig_; + } + return com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Manual routing.
+       * 
+ * + * + * .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig.ManualRoutingMode manual_mode = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .Builder, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig + .ManualRoutingModeOrBuilder> + getManualModeFieldBuilder() { + if (manualModeBuilder_ == null) { + if (!(routingConfigCase_ == 2)) { + routingConfig_ = + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .getDefaultInstance(); + } + manualModeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode + .Builder, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig + .ManualRoutingModeOrBuilder>( + (com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.ManualRoutingMode) + routingConfig_, + getParentForChildren(), + isClean()); + routingConfig_ = null; + } + routingConfigCase_ = 2; + onChanged(); + return manualModeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1.GenerationConfig.RoutingConfig) + private static final com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig(); + } + + public static com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RoutingConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + private int bitField0_; public static final int TEMPERATURE_FIELD_NUMBER = 1; private float temperature_ = 0F; @@ -348,16 +3324,49 @@ public boolean hasFrequencyPenalty() { * * *
-   * Optional. Frequency penalties.
+   * Optional. Frequency penalties.
+   * 
+ * + * optional float frequency_penalty = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The frequencyPenalty. + */ + @java.lang.Override + public float getFrequencyPenalty() { + return frequencyPenalty_; + } + + public static final int SEED_FIELD_NUMBER = 12; + private int seed_ = 0; + /** + * + * + *
+   * Optional. Seed.
+   * 
+ * + * optional int32 seed = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the seed field is set. + */ + @java.lang.Override + public boolean hasSeed() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+   * Optional. Seed.
    * 
* - * optional float frequency_penalty = 9 [(.google.api.field_behavior) = OPTIONAL]; + * optional int32 seed = 12 [(.google.api.field_behavior) = OPTIONAL]; * - * @return The frequencyPenalty. + * @return The seed. */ @java.lang.Override - public float getFrequencyPenalty() { - return frequencyPenalty_; + public int getSeed() { + return seed_; } public static final int RESPONSE_MIME_TYPE_FIELD_NUMBER = 13; @@ -446,7 +3455,7 @@ public com.google.protobuf.ByteString getResponseMimeTypeBytes() { */ @java.lang.Override public boolean hasResponseSchema() { - return ((bitField0_ & 0x00000080) != 0); + return ((bitField0_ & 0x00000100) != 0); } /** * @@ -497,6 +3506,63 @@ public com.google.cloud.vertexai.api.SchemaOrBuilder getResponseSchemaOrBuilder( : responseSchema_; } + public static final int ROUTING_CONFIG_FIELD_NUMBER = 17; + private com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig routingConfig_; + /** + * + * + *
+   * Optional. Routing configuration.
+   * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routingConfig field is set. + */ + @java.lang.Override + public boolean hasRoutingConfig() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+   * Optional. Routing configuration.
+   * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingConfig. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig getRoutingConfig() { + return routingConfig_ == null + ? com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.getDefaultInstance() + : routingConfig_; + } + /** + * + * + *
+   * Optional. Routing configuration.
+   * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfigOrBuilder + getRoutingConfigOrBuilder() { + return routingConfig_ == null + ? com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.getDefaultInstance() + : routingConfig_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -535,12 +3601,18 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000040) != 0)) { output.writeFloat(9, frequencyPenalty_); } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeInt32(12, seed_); + } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(responseMimeType_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 13, responseMimeType_); } - if (((bitField0_ & 0x00000080) != 0)) { + if (((bitField0_ & 0x00000100) != 0)) { output.writeMessage(16, getResponseSchema()); } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeMessage(17, getRoutingConfig()); + } getUnknownFields().writeTo(output); } @@ -579,12 +3651,18 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000040) != 0)) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(9, frequencyPenalty_); } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(12, seed_); + } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(responseMimeType_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, responseMimeType_); } - if (((bitField0_ & 0x00000080) != 0)) { + if (((bitField0_ & 0x00000100) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getResponseSchema()); } + if (((bitField0_ & 0x00000200) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getRoutingConfig()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -635,11 +3713,19 @@ public boolean equals(final java.lang.Object obj) { if (java.lang.Float.floatToIntBits(getFrequencyPenalty()) != java.lang.Float.floatToIntBits(other.getFrequencyPenalty())) return false; } + if (hasSeed() != other.hasSeed()) return false; + if (hasSeed()) { + if (getSeed() != other.getSeed()) return false; + } if (!getResponseMimeType().equals(other.getResponseMimeType())) return false; if (hasResponseSchema() != other.hasResponseSchema()) return false; if (hasResponseSchema()) { if (!getResponseSchema().equals(other.getResponseSchema())) return false; } + if (hasRoutingConfig() != other.hasRoutingConfig()) return false; + if (hasRoutingConfig()) { + if (!getRoutingConfig().equals(other.getRoutingConfig())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -683,12 +3769,20 @@ public int hashCode() { hash = (37 * hash) + FREQUENCY_PENALTY_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits(getFrequencyPenalty()); } + if (hasSeed()) { + hash = (37 * hash) + SEED_FIELD_NUMBER; + hash = (53 * hash) + getSeed(); + } hash = (37 * hash) + RESPONSE_MIME_TYPE_FIELD_NUMBER; hash = (53 * hash) + getResponseMimeType().hashCode(); if (hasResponseSchema()) { hash = (37 * hash) + RESPONSE_SCHEMA_FIELD_NUMBER; hash = (53 * hash) + getResponseSchema().hashCode(); } + if (hasRoutingConfig()) { + hash = (37 * hash) + ROUTING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getRoutingConfig().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -830,6 +3924,7 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getResponseSchemaFieldBuilder(); + getRoutingConfigFieldBuilder(); } } @@ -845,12 +3940,18 @@ public Builder clear() { stopSequences_ = com.google.protobuf.LazyStringArrayList.emptyList(); presencePenalty_ = 0F; frequencyPenalty_ = 0F; + seed_ = 0; responseMimeType_ = ""; responseSchema_ = null; if (responseSchemaBuilder_ != null) { responseSchemaBuilder_.dispose(); responseSchemaBuilder_ = null; } + routingConfig_ = null; + if (routingConfigBuilder_ != null) { + routingConfigBuilder_.dispose(); + routingConfigBuilder_ = null; + } return this; } @@ -921,12 +4022,21 @@ private void buildPartial0(com.google.cloud.vertexai.api.GenerationConfig result to_bitField0_ |= 0x00000040; } if (((from_bitField0_ & 0x00000100) != 0)) { - result.responseMimeType_ = responseMimeType_; + result.seed_ = seed_; + to_bitField0_ |= 0x00000080; } if (((from_bitField0_ & 0x00000200) != 0)) { + result.responseMimeType_ = responseMimeType_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { result.responseSchema_ = responseSchemaBuilder_ == null ? responseSchema_ : responseSchemaBuilder_.build(); - to_bitField0_ |= 0x00000080; + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.routingConfig_ = + routingConfigBuilder_ == null ? routingConfig_ : routingConfigBuilder_.build(); + to_bitField0_ |= 0x00000200; } result.bitField0_ |= to_bitField0_; } @@ -1007,14 +4117,20 @@ public Builder mergeFrom(com.google.cloud.vertexai.api.GenerationConfig other) { if (other.hasFrequencyPenalty()) { setFrequencyPenalty(other.getFrequencyPenalty()); } + if (other.hasSeed()) { + setSeed(other.getSeed()); + } if (!other.getResponseMimeType().isEmpty()) { responseMimeType_ = other.responseMimeType_; - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); } if (other.hasResponseSchema()) { mergeResponseSchema(other.getResponseSchema()); } + if (other.hasRoutingConfig()) { + mergeRoutingConfig(other.getRoutingConfig()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1090,18 +4206,30 @@ public Builder mergeFrom( bitField0_ |= 0x00000080; break; } // case 77 + case 96: + { + seed_ = input.readInt32(); + bitField0_ |= 0x00000100; + break; + } // case 96 case 106: { responseMimeType_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; break; } // case 106 case 130: { input.readMessage(getResponseSchemaFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; break; } // case 130 + case 138: + { + input.readMessage(getRoutingConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 138 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1771,6 +4899,74 @@ public Builder clearFrequencyPenalty() { return this; } + private int seed_; + /** + * + * + *
+     * Optional. Seed.
+     * 
+ * + * optional int32 seed = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the seed field is set. + */ + @java.lang.Override + public boolean hasSeed() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Optional. Seed.
+     * 
+ * + * optional int32 seed = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The seed. + */ + @java.lang.Override + public int getSeed() { + return seed_; + } + /** + * + * + *
+     * Optional. Seed.
+     * 
+ * + * optional int32 seed = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The seed to set. + * @return This builder for chaining. + */ + public Builder setSeed(int value) { + + seed_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Seed.
+     * 
+ * + * optional int32 seed = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearSeed() { + bitField0_ = (bitField0_ & ~0x00000100); + seed_ = 0; + onChanged(); + return this; + } + private java.lang.Object responseMimeType_ = ""; /** * @@ -1851,7 +5047,7 @@ public Builder setResponseMimeType(java.lang.String value) { throw new NullPointerException(); } responseMimeType_ = value; - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return this; } @@ -1874,7 +5070,7 @@ public Builder setResponseMimeType(java.lang.String value) { */ public Builder clearResponseMimeType() { responseMimeType_ = getDefaultInstance().getResponseMimeType(); - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000200); onChanged(); return this; } @@ -1902,7 +5098,7 @@ public Builder setResponseMimeTypeBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); responseMimeType_ = value; - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return this; } @@ -1933,7 +5129,7 @@ public Builder setResponseMimeTypeBytes(com.google.protobuf.ByteString value) { * @return Whether the responseSchema field is set. */ public boolean hasResponseSchema() { - return ((bitField0_ & 0x00000200) != 0); + return ((bitField0_ & 0x00000400) != 0); } /** * @@ -1989,7 +5185,7 @@ public Builder setResponseSchema(com.google.cloud.vertexai.api.Schema value) { } else { responseSchemaBuilder_.setMessage(value); } - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -2016,7 +5212,7 @@ public Builder setResponseSchema(com.google.cloud.vertexai.api.Schema.Builder bu } else { responseSchemaBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -2039,7 +5235,7 @@ public Builder setResponseSchema(com.google.cloud.vertexai.api.Schema.Builder bu */ public Builder mergeResponseSchema(com.google.cloud.vertexai.api.Schema value) { if (responseSchemaBuilder_ == null) { - if (((bitField0_ & 0x00000200) != 0) + if (((bitField0_ & 0x00000400) != 0) && responseSchema_ != null && responseSchema_ != com.google.cloud.vertexai.api.Schema.getDefaultInstance()) { getResponseSchemaBuilder().mergeFrom(value); @@ -2050,7 +5246,7 @@ public Builder mergeResponseSchema(com.google.cloud.vertexai.api.Schema value) { responseSchemaBuilder_.mergeFrom(value); } if (responseSchema_ != null) { - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); } return this; @@ -2073,7 +5269,7 @@ public Builder mergeResponseSchema(com.google.cloud.vertexai.api.Schema value) { *
*/ public Builder clearResponseSchema() { - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000400); responseSchema_ = null; if (responseSchemaBuilder_ != null) { responseSchemaBuilder_.dispose(); @@ -2100,7 +5296,7 @@ public Builder clearResponseSchema() { *
*/ public com.google.cloud.vertexai.api.Schema.Builder getResponseSchemaBuilder() { - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); return getResponseSchemaFieldBuilder().getBuilder(); } @@ -2164,6 +5360,216 @@ public com.google.cloud.vertexai.api.SchemaOrBuilder getResponseSchemaOrBuilder( return responseSchemaBuilder_; } + private com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig routingConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.Builder, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfigOrBuilder> + routingConfigBuilder_; + /** + * + * + *
+     * Optional. Routing configuration.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routingConfig field is set. + */ + public boolean hasRoutingConfig() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Optional. Routing configuration.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingConfig. + */ + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig getRoutingConfig() { + if (routingConfigBuilder_ == null) { + return routingConfig_ == null + ? com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.getDefaultInstance() + : routingConfig_; + } else { + return routingConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Routing configuration.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRoutingConfig( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig value) { + if (routingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routingConfig_ = value; + } else { + routingConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Routing configuration.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRoutingConfig( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.Builder builderForValue) { + if (routingConfigBuilder_ == null) { + routingConfig_ = builderForValue.build(); + } else { + routingConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Routing configuration.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRoutingConfig( + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig value) { + if (routingConfigBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && routingConfig_ != null + && routingConfig_ + != com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig + .getDefaultInstance()) { + getRoutingConfigBuilder().mergeFrom(value); + } else { + routingConfig_ = value; + } + } else { + routingConfigBuilder_.mergeFrom(value); + } + if (routingConfig_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Routing configuration.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRoutingConfig() { + bitField0_ = (bitField0_ & ~0x00000800); + routingConfig_ = null; + if (routingConfigBuilder_ != null) { + routingConfigBuilder_.dispose(); + routingConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Routing configuration.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.Builder + getRoutingConfigBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getRoutingConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Routing configuration.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.GenerationConfig.RoutingConfigOrBuilder + getRoutingConfigOrBuilder() { + if (routingConfigBuilder_ != null) { + return routingConfigBuilder_.getMessageOrBuilder(); + } else { + return routingConfig_ == null + ? com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.getDefaultInstance() + : routingConfig_; + } + } + /** + * + * + *
+     * Optional. Routing configuration.
+     * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.Builder, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfigOrBuilder> + getRoutingConfigFieldBuilder() { + if (routingConfigBuilder_ == null) { + routingConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig.Builder, + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfigOrBuilder>( + getRoutingConfig(), getParentForChildren(), isClean()); + routingConfig_ = null; + } + return routingConfigBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerationConfigOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerationConfigOrBuilder.java index 2b9017051f25..c65a9bd1db35 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerationConfigOrBuilder.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GenerationConfigOrBuilder.java @@ -250,6 +250,31 @@ public interface GenerationConfigOrBuilder */ float getFrequencyPenalty(); + /** + * + * + *
+   * Optional. Seed.
+   * 
+ * + * optional int32 seed = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the seed field is set. + */ + boolean hasSeed(); + /** + * + * + *
+   * Optional. Seed.
+   * 
+ * + * optional int32 seed = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The seed. + */ + int getSeed(); + /** * * @@ -345,4 +370,45 @@ public interface GenerationConfigOrBuilder *
*/ com.google.cloud.vertexai.api.SchemaOrBuilder getResponseSchemaOrBuilder(); + + /** + * + * + *
+   * Optional. Routing configuration.
+   * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the routingConfig field is set. + */ + boolean hasRoutingConfig(); + /** + * + * + *
+   * Optional. Routing configuration.
+   * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The routingConfig. + */ + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfig getRoutingConfig(); + /** + * + * + *
+   * Optional. Routing configuration.
+   * 
+ * + * + * optional .google.cloud.vertexai.v1.GenerationConfig.RoutingConfig routing_config = 17 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.GenerationConfig.RoutingConfigOrBuilder getRoutingConfigOrBuilder(); } diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingChunk.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingChunk.java new file mode 100644 index 000000000000..24998f312927 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingChunk.java @@ -0,0 +1,3020 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1/content.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Grounding chunk.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.GroundingChunk} + */ +public final class GroundingChunk extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1.GroundingChunk) + GroundingChunkOrBuilder { + private static final long serialVersionUID = 0L; + // Use GroundingChunk.newBuilder() to construct. + private GroundingChunk(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GroundingChunk() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GroundingChunk(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GroundingChunk.class, + com.google.cloud.vertexai.api.GroundingChunk.Builder.class); + } + + public interface WebOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1.GroundingChunk.Web) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * URI reference of the chunk.
+     * 
+ * + * optional string uri = 1; + * + * @return Whether the uri field is set. + */ + boolean hasUri(); + /** + * + * + *
+     * URI reference of the chunk.
+     * 
+ * + * optional string uri = 1; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+     * URI reference of the chunk.
+     * 
+ * + * optional string uri = 1; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+     * Title of the chunk.
+     * 
+ * + * optional string title = 2; + * + * @return Whether the title field is set. + */ + boolean hasTitle(); + /** + * + * + *
+     * Title of the chunk.
+     * 
+ * + * optional string title = 2; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+     * Title of the chunk.
+     * 
+ * + * optional string title = 2; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + } + /** + * + * + *
+   * Chunk from the web.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.GroundingChunk.Web} + */ + public static final class Web extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1.GroundingChunk.Web) + WebOrBuilder { + private static final long serialVersionUID = 0L; + // Use Web.newBuilder() to construct. + private Web(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Web() { + uri_ = ""; + title_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Web(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_Web_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_Web_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GroundingChunk.Web.class, + com.google.cloud.vertexai.api.GroundingChunk.Web.Builder.class); + } + + private int bitField0_; + public static final int URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + /** + * + * + *
+     * URI reference of the chunk.
+     * 
+ * + * optional string uri = 1; + * + * @return Whether the uri field is set. + */ + @java.lang.Override + public boolean hasUri() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * URI reference of the chunk.
+     * 
+ * + * optional string uri = 1; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * + * + *
+     * URI reference of the chunk.
+     * 
+ * + * optional string uri = 1; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + /** + * + * + *
+     * Title of the chunk.
+     * 
+ * + * optional string title = 2; + * + * @return Whether the title field is set. + */ + @java.lang.Override + public boolean hasTitle() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Title of the chunk.
+     * 
+ * + * optional string title = 2; + * + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * + * + *
+     * Title of the chunk.
+     * 
+ * + * optional string title = 2; + * + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, title_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, title_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GroundingChunk.Web)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GroundingChunk.Web other = + (com.google.cloud.vertexai.api.GroundingChunk.Web) obj; + + if (hasUri() != other.hasUri()) return false; + if (hasUri()) { + if (!getUri().equals(other.getUri())) return false; + } + if (hasTitle() != other.hasTitle()) return false; + if (hasTitle()) { + if (!getTitle().equals(other.getTitle())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUri()) { + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + } + if (hasTitle()) { + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GroundingChunk.Web parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.Web parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.Web parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.Web parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.Web parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.Web parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.Web parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.Web parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.Web parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.Web parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.Web parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.Web parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.GroundingChunk.Web prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Chunk from the web.
+     * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.GroundingChunk.Web} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1.GroundingChunk.Web) + com.google.cloud.vertexai.api.GroundingChunk.WebOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_Web_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_Web_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GroundingChunk.Web.class, + com.google.cloud.vertexai.api.GroundingChunk.Web.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.GroundingChunk.Web.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uri_ = ""; + title_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_Web_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.Web getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GroundingChunk.Web.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.Web build() { + com.google.cloud.vertexai.api.GroundingChunk.Web result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.Web buildPartial() { + com.google.cloud.vertexai.api.GroundingChunk.Web result = + new com.google.cloud.vertexai.api.GroundingChunk.Web(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.GroundingChunk.Web result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.uri_ = uri_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.title_ = title_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GroundingChunk.Web) { + return mergeFrom((com.google.cloud.vertexai.api.GroundingChunk.Web) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.GroundingChunk.Web other) { + if (other == com.google.cloud.vertexai.api.GroundingChunk.Web.getDefaultInstance()) + return this; + if (other.hasUri()) { + uri_ = other.uri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasTitle()) { + title_ = other.title_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + title_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + /** + * + * + *
+       * URI reference of the chunk.
+       * 
+ * + * optional string uri = 1; + * + * @return Whether the uri field is set. + */ + public boolean hasUri() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * URI reference of the chunk.
+       * 
+ * + * optional string uri = 1; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * URI reference of the chunk.
+       * 
+ * + * optional string uri = 1; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * URI reference of the chunk.
+       * 
+ * + * optional string uri = 1; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * URI reference of the chunk.
+       * 
+ * + * optional string uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * URI reference of the chunk.
+       * 
+ * + * optional string uri = 1; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * + * + *
+       * Title of the chunk.
+       * 
+ * + * optional string title = 2; + * + * @return Whether the title field is set. + */ + public boolean hasTitle() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Title of the chunk.
+       * 
+ * + * optional string title = 2; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Title of the chunk.
+       * 
+ * + * optional string title = 2; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Title of the chunk.
+       * 
+ * + * optional string title = 2; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + title_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Title of the chunk.
+       * 
+ * + * optional string title = 2; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + title_ = getDefaultInstance().getTitle(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Title of the chunk.
+       * 
+ * + * optional string title = 2; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + title_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1.GroundingChunk.Web) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1.GroundingChunk.Web) + private static final com.google.cloud.vertexai.api.GroundingChunk.Web DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GroundingChunk.Web(); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.Web getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Web parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.Web getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RetrievedContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1.GroundingChunk.RetrievedContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * URI reference of the attribution.
+     * 
+ * + * optional string uri = 1; + * + * @return Whether the uri field is set. + */ + boolean hasUri(); + /** + * + * + *
+     * URI reference of the attribution.
+     * 
+ * + * optional string uri = 1; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+     * URI reference of the attribution.
+     * 
+ * + * optional string uri = 1; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+     * Title of the attribution.
+     * 
+ * + * optional string title = 2; + * + * @return Whether the title field is set. + */ + boolean hasTitle(); + /** + * + * + *
+     * Title of the attribution.
+     * 
+ * + * optional string title = 2; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+     * Title of the attribution.
+     * 
+ * + * optional string title = 2; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + } + /** + * + * + *
+   * Chunk from context retrieved by the retrieval tools.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.GroundingChunk.RetrievedContext} + */ + public static final class RetrievedContext extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1.GroundingChunk.RetrievedContext) + RetrievedContextOrBuilder { + private static final long serialVersionUID = 0L; + // Use RetrievedContext.newBuilder() to construct. + private RetrievedContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RetrievedContext() { + uri_ = ""; + title_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RetrievedContext(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_RetrievedContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_RetrievedContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.class, + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.Builder.class); + } + + private int bitField0_; + public static final int URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + /** + * + * + *
+     * URI reference of the attribution.
+     * 
+ * + * optional string uri = 1; + * + * @return Whether the uri field is set. + */ + @java.lang.Override + public boolean hasUri() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * URI reference of the attribution.
+     * 
+ * + * optional string uri = 1; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * + * + *
+     * URI reference of the attribution.
+     * 
+ * + * optional string uri = 1; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + /** + * + * + *
+     * Title of the attribution.
+     * 
+ * + * optional string title = 2; + * + * @return Whether the title field is set. + */ + @java.lang.Override + public boolean hasTitle() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Title of the attribution.
+     * 
+ * + * optional string title = 2; + * + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * + * + *
+     * Title of the attribution.
+     * 
+ * + * optional string title = 2; + * + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, title_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, title_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext other = + (com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext) obj; + + if (hasUri() != other.hasUri()) return false; + if (hasUri()) { + if (!getUri().equals(other.getUri())) return false; + } + if (hasTitle() != other.hasTitle()) return false; + if (hasTitle()) { + if (!getTitle().equals(other.getTitle())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUri()) { + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + } + if (hasTitle()) { + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Chunk from context retrieved by the retrieval tools.
+     * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.GroundingChunk.RetrievedContext} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1.GroundingChunk.RetrievedContext) + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_RetrievedContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_RetrievedContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.class, + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uri_ = ""; + title_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_RetrievedContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext + getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext build() { + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext buildPartial() { + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext result = + new com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.uri_ = uri_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.title_ = title_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext) { + return mergeFrom((com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext other) { + if (other + == com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.getDefaultInstance()) + return this; + if (other.hasUri()) { + uri_ = other.uri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasTitle()) { + title_ = other.title_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + title_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + /** + * + * + *
+       * URI reference of the attribution.
+       * 
+ * + * optional string uri = 1; + * + * @return Whether the uri field is set. + */ + public boolean hasUri() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * URI reference of the attribution.
+       * 
+ * + * optional string uri = 1; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * URI reference of the attribution.
+       * 
+ * + * optional string uri = 1; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * URI reference of the attribution.
+       * 
+ * + * optional string uri = 1; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * URI reference of the attribution.
+       * 
+ * + * optional string uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * URI reference of the attribution.
+       * 
+ * + * optional string uri = 1; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + /** + * + * + *
+       * Title of the attribution.
+       * 
+ * + * optional string title = 2; + * + * @return Whether the title field is set. + */ + public boolean hasTitle() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Title of the attribution.
+       * 
+ * + * optional string title = 2; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Title of the attribution.
+       * 
+ * + * optional string title = 2; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Title of the attribution.
+       * 
+ * + * optional string title = 2; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + title_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Title of the attribution.
+       * 
+ * + * optional string title = 2; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + title_ = getDefaultInstance().getTitle(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Title of the attribution.
+       * 
+ * + * optional string title = 2; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + title_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1.GroundingChunk.RetrievedContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1.GroundingChunk.RetrievedContext) + private static final com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext(); + } + + public static com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RetrievedContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int chunkTypeCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object chunkType_; + + public enum ChunkTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + WEB(1), + RETRIEVED_CONTEXT(2), + CHUNKTYPE_NOT_SET(0); + private final int value; + + private ChunkTypeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ChunkTypeCase valueOf(int value) { + return forNumber(value); + } + + public static ChunkTypeCase forNumber(int value) { + switch (value) { + case 1: + return WEB; + case 2: + return RETRIEVED_CONTEXT; + case 0: + return CHUNKTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ChunkTypeCase getChunkTypeCase() { + return ChunkTypeCase.forNumber(chunkTypeCase_); + } + + public static final int WEB_FIELD_NUMBER = 1; + /** + * + * + *
+   * Grounding chunk from the web.
+   * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + * + * @return Whether the web field is set. + */ + @java.lang.Override + public boolean hasWeb() { + return chunkTypeCase_ == 1; + } + /** + * + * + *
+   * Grounding chunk from the web.
+   * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + * + * @return The web. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.Web getWeb() { + if (chunkTypeCase_ == 1) { + return (com.google.cloud.vertexai.api.GroundingChunk.Web) chunkType_; + } + return com.google.cloud.vertexai.api.GroundingChunk.Web.getDefaultInstance(); + } + /** + * + * + *
+   * Grounding chunk from the web.
+   * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.WebOrBuilder getWebOrBuilder() { + if (chunkTypeCase_ == 1) { + return (com.google.cloud.vertexai.api.GroundingChunk.Web) chunkType_; + } + return com.google.cloud.vertexai.api.GroundingChunk.Web.getDefaultInstance(); + } + + public static final int RETRIEVED_CONTEXT_FIELD_NUMBER = 2; + /** + * + * + *
+   * Grounding chunk from context retrieved by the retrieval tools.
+   * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + * + * @return Whether the retrievedContext field is set. + */ + @java.lang.Override + public boolean hasRetrievedContext() { + return chunkTypeCase_ == 2; + } + /** + * + * + *
+   * Grounding chunk from context retrieved by the retrieval tools.
+   * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + * + * @return The retrievedContext. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext getRetrievedContext() { + if (chunkTypeCase_ == 2) { + return (com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext) chunkType_; + } + return com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.getDefaultInstance(); + } + /** + * + * + *
+   * Grounding chunk from context retrieved by the retrieval tools.
+   * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.RetrievedContextOrBuilder + getRetrievedContextOrBuilder() { + if (chunkTypeCase_ == 2) { + return (com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext) chunkType_; + } + return com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (chunkTypeCase_ == 1) { + output.writeMessage(1, (com.google.cloud.vertexai.api.GroundingChunk.Web) chunkType_); + } + if (chunkTypeCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext) chunkType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (chunkTypeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.vertexai.api.GroundingChunk.Web) chunkType_); + } + if (chunkTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext) chunkType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GroundingChunk)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GroundingChunk other = + (com.google.cloud.vertexai.api.GroundingChunk) obj; + + if (!getChunkTypeCase().equals(other.getChunkTypeCase())) return false; + switch (chunkTypeCase_) { + case 1: + if (!getWeb().equals(other.getWeb())) return false; + break; + case 2: + if (!getRetrievedContext().equals(other.getRetrievedContext())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (chunkTypeCase_) { + case 1: + hash = (37 * hash) + WEB_FIELD_NUMBER; + hash = (53 * hash) + getWeb().hashCode(); + break; + case 2: + hash = (37 * hash) + RETRIEVED_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getRetrievedContext().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GroundingChunk parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GroundingChunk parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GroundingChunk parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GroundingChunk parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GroundingChunk parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GroundingChunk parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingChunk parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GroundingChunk parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.GroundingChunk prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Grounding chunk.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.GroundingChunk} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1.GroundingChunk) + com.google.cloud.vertexai.api.GroundingChunkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GroundingChunk.class, + com.google.cloud.vertexai.api.GroundingChunk.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.GroundingChunk.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (webBuilder_ != null) { + webBuilder_.clear(); + } + if (retrievedContextBuilder_ != null) { + retrievedContextBuilder_.clear(); + } + chunkTypeCase_ = 0; + chunkType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingChunk_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GroundingChunk.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk build() { + com.google.cloud.vertexai.api.GroundingChunk result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk buildPartial() { + com.google.cloud.vertexai.api.GroundingChunk result = + new com.google.cloud.vertexai.api.GroundingChunk(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.GroundingChunk result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.vertexai.api.GroundingChunk result) { + result.chunkTypeCase_ = chunkTypeCase_; + result.chunkType_ = this.chunkType_; + if (chunkTypeCase_ == 1 && webBuilder_ != null) { + result.chunkType_ = webBuilder_.build(); + } + if (chunkTypeCase_ == 2 && retrievedContextBuilder_ != null) { + result.chunkType_ = retrievedContextBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GroundingChunk) { + return mergeFrom((com.google.cloud.vertexai.api.GroundingChunk) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.GroundingChunk other) { + if (other == com.google.cloud.vertexai.api.GroundingChunk.getDefaultInstance()) return this; + switch (other.getChunkTypeCase()) { + case WEB: + { + mergeWeb(other.getWeb()); + break; + } + case RETRIEVED_CONTEXT: + { + mergeRetrievedContext(other.getRetrievedContext()); + break; + } + case CHUNKTYPE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getWebFieldBuilder().getBuilder(), extensionRegistry); + chunkTypeCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + getRetrievedContextFieldBuilder().getBuilder(), extensionRegistry); + chunkTypeCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int chunkTypeCase_ = 0; + private java.lang.Object chunkType_; + + public ChunkTypeCase getChunkTypeCase() { + return ChunkTypeCase.forNumber(chunkTypeCase_); + } + + public Builder clearChunkType() { + chunkTypeCase_ = 0; + chunkType_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GroundingChunk.Web, + com.google.cloud.vertexai.api.GroundingChunk.Web.Builder, + com.google.cloud.vertexai.api.GroundingChunk.WebOrBuilder> + webBuilder_; + /** + * + * + *
+     * Grounding chunk from the web.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + * + * @return Whether the web field is set. + */ + @java.lang.Override + public boolean hasWeb() { + return chunkTypeCase_ == 1; + } + /** + * + * + *
+     * Grounding chunk from the web.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + * + * @return The web. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.Web getWeb() { + if (webBuilder_ == null) { + if (chunkTypeCase_ == 1) { + return (com.google.cloud.vertexai.api.GroundingChunk.Web) chunkType_; + } + return com.google.cloud.vertexai.api.GroundingChunk.Web.getDefaultInstance(); + } else { + if (chunkTypeCase_ == 1) { + return webBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.GroundingChunk.Web.getDefaultInstance(); + } + } + /** + * + * + *
+     * Grounding chunk from the web.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + */ + public Builder setWeb(com.google.cloud.vertexai.api.GroundingChunk.Web value) { + if (webBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + chunkType_ = value; + onChanged(); + } else { + webBuilder_.setMessage(value); + } + chunkTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Grounding chunk from the web.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + */ + public Builder setWeb( + com.google.cloud.vertexai.api.GroundingChunk.Web.Builder builderForValue) { + if (webBuilder_ == null) { + chunkType_ = builderForValue.build(); + onChanged(); + } else { + webBuilder_.setMessage(builderForValue.build()); + } + chunkTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Grounding chunk from the web.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + */ + public Builder mergeWeb(com.google.cloud.vertexai.api.GroundingChunk.Web value) { + if (webBuilder_ == null) { + if (chunkTypeCase_ == 1 + && chunkType_ + != com.google.cloud.vertexai.api.GroundingChunk.Web.getDefaultInstance()) { + chunkType_ = + com.google.cloud.vertexai.api.GroundingChunk.Web.newBuilder( + (com.google.cloud.vertexai.api.GroundingChunk.Web) chunkType_) + .mergeFrom(value) + .buildPartial(); + } else { + chunkType_ = value; + } + onChanged(); + } else { + if (chunkTypeCase_ == 1) { + webBuilder_.mergeFrom(value); + } else { + webBuilder_.setMessage(value); + } + } + chunkTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Grounding chunk from the web.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + */ + public Builder clearWeb() { + if (webBuilder_ == null) { + if (chunkTypeCase_ == 1) { + chunkTypeCase_ = 0; + chunkType_ = null; + onChanged(); + } + } else { + if (chunkTypeCase_ == 1) { + chunkTypeCase_ = 0; + chunkType_ = null; + } + webBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Grounding chunk from the web.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + */ + public com.google.cloud.vertexai.api.GroundingChunk.Web.Builder getWebBuilder() { + return getWebFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Grounding chunk from the web.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.WebOrBuilder getWebOrBuilder() { + if ((chunkTypeCase_ == 1) && (webBuilder_ != null)) { + return webBuilder_.getMessageOrBuilder(); + } else { + if (chunkTypeCase_ == 1) { + return (com.google.cloud.vertexai.api.GroundingChunk.Web) chunkType_; + } + return com.google.cloud.vertexai.api.GroundingChunk.Web.getDefaultInstance(); + } + } + /** + * + * + *
+     * Grounding chunk from the web.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GroundingChunk.Web, + com.google.cloud.vertexai.api.GroundingChunk.Web.Builder, + com.google.cloud.vertexai.api.GroundingChunk.WebOrBuilder> + getWebFieldBuilder() { + if (webBuilder_ == null) { + if (!(chunkTypeCase_ == 1)) { + chunkType_ = com.google.cloud.vertexai.api.GroundingChunk.Web.getDefaultInstance(); + } + webBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GroundingChunk.Web, + com.google.cloud.vertexai.api.GroundingChunk.Web.Builder, + com.google.cloud.vertexai.api.GroundingChunk.WebOrBuilder>( + (com.google.cloud.vertexai.api.GroundingChunk.Web) chunkType_, + getParentForChildren(), + isClean()); + chunkType_ = null; + } + chunkTypeCase_ = 1; + onChanged(); + return webBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext, + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.Builder, + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContextOrBuilder> + retrievedContextBuilder_; + /** + * + * + *
+     * Grounding chunk from context retrieved by the retrieval tools.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + * + * @return Whether the retrievedContext field is set. + */ + @java.lang.Override + public boolean hasRetrievedContext() { + return chunkTypeCase_ == 2; + } + /** + * + * + *
+     * Grounding chunk from context retrieved by the retrieval tools.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + * + * @return The retrievedContext. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext getRetrievedContext() { + if (retrievedContextBuilder_ == null) { + if (chunkTypeCase_ == 2) { + return (com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext) chunkType_; + } + return com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.getDefaultInstance(); + } else { + if (chunkTypeCase_ == 2) { + return retrievedContextBuilder_.getMessage(); + } + return com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.getDefaultInstance(); + } + } + /** + * + * + *
+     * Grounding chunk from context retrieved by the retrieval tools.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + */ + public Builder setRetrievedContext( + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext value) { + if (retrievedContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + chunkType_ = value; + onChanged(); + } else { + retrievedContextBuilder_.setMessage(value); + } + chunkTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Grounding chunk from context retrieved by the retrieval tools.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + */ + public Builder setRetrievedContext( + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.Builder builderForValue) { + if (retrievedContextBuilder_ == null) { + chunkType_ = builderForValue.build(); + onChanged(); + } else { + retrievedContextBuilder_.setMessage(builderForValue.build()); + } + chunkTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Grounding chunk from context retrieved by the retrieval tools.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + */ + public Builder mergeRetrievedContext( + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext value) { + if (retrievedContextBuilder_ == null) { + if (chunkTypeCase_ == 2 + && chunkType_ + != com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext + .getDefaultInstance()) { + chunkType_ = + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.newBuilder( + (com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext) chunkType_) + .mergeFrom(value) + .buildPartial(); + } else { + chunkType_ = value; + } + onChanged(); + } else { + if (chunkTypeCase_ == 2) { + retrievedContextBuilder_.mergeFrom(value); + } else { + retrievedContextBuilder_.setMessage(value); + } + } + chunkTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Grounding chunk from context retrieved by the retrieval tools.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + */ + public Builder clearRetrievedContext() { + if (retrievedContextBuilder_ == null) { + if (chunkTypeCase_ == 2) { + chunkTypeCase_ = 0; + chunkType_ = null; + onChanged(); + } + } else { + if (chunkTypeCase_ == 2) { + chunkTypeCase_ = 0; + chunkType_ = null; + } + retrievedContextBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Grounding chunk from context retrieved by the retrieval tools.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + */ + public com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.Builder + getRetrievedContextBuilder() { + return getRetrievedContextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Grounding chunk from context retrieved by the retrieval tools.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk.RetrievedContextOrBuilder + getRetrievedContextOrBuilder() { + if ((chunkTypeCase_ == 2) && (retrievedContextBuilder_ != null)) { + return retrievedContextBuilder_.getMessageOrBuilder(); + } else { + if (chunkTypeCase_ == 2) { + return (com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext) chunkType_; + } + return com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.getDefaultInstance(); + } + } + /** + * + * + *
+     * Grounding chunk from context retrieved by the retrieval tools.
+     * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext, + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.Builder, + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContextOrBuilder> + getRetrievedContextFieldBuilder() { + if (retrievedContextBuilder_ == null) { + if (!(chunkTypeCase_ == 2)) { + chunkType_ = + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.getDefaultInstance(); + } + retrievedContextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext, + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext.Builder, + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContextOrBuilder>( + (com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext) chunkType_, + getParentForChildren(), + isClean()); + chunkType_ = null; + } + chunkTypeCase_ = 2; + onChanged(); + return retrievedContextBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1.GroundingChunk) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1.GroundingChunk) + private static final com.google.cloud.vertexai.api.GroundingChunk DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GroundingChunk(); + } + + public static com.google.cloud.vertexai.api.GroundingChunk getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GroundingChunk parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingChunkOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingChunkOrBuilder.java new file mode 100644 index 000000000000..32c67141c09e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingChunkOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1/content.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.vertexai.api; + +public interface GroundingChunkOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1.GroundingChunk) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Grounding chunk from the web.
+   * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + * + * @return Whether the web field is set. + */ + boolean hasWeb(); + /** + * + * + *
+   * Grounding chunk from the web.
+   * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + * + * @return The web. + */ + com.google.cloud.vertexai.api.GroundingChunk.Web getWeb(); + /** + * + * + *
+   * Grounding chunk from the web.
+   * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.Web web = 1; + */ + com.google.cloud.vertexai.api.GroundingChunk.WebOrBuilder getWebOrBuilder(); + + /** + * + * + *
+   * Grounding chunk from context retrieved by the retrieval tools.
+   * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + * + * @return Whether the retrievedContext field is set. + */ + boolean hasRetrievedContext(); + /** + * + * + *
+   * Grounding chunk from context retrieved by the retrieval tools.
+   * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + * + * @return The retrievedContext. + */ + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContext getRetrievedContext(); + /** + * + * + *
+   * Grounding chunk from context retrieved by the retrieval tools.
+   * 
+ * + * .google.cloud.vertexai.v1.GroundingChunk.RetrievedContext retrieved_context = 2; + */ + com.google.cloud.vertexai.api.GroundingChunk.RetrievedContextOrBuilder + getRetrievedContextOrBuilder(); + + com.google.cloud.vertexai.api.GroundingChunk.ChunkTypeCase getChunkTypeCase(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingMetadata.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingMetadata.java index fe28efb19407..f797b6e0b09c 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingMetadata.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingMetadata.java @@ -40,6 +40,8 @@ private GroundingMetadata(com.google.protobuf.GeneratedMessageV3.Builder buil private GroundingMetadata() { webSearchQueries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + groundingChunks_ = java.util.Collections.emptyList(); + groundingSupports_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -184,6 +186,160 @@ public com.google.cloud.vertexai.api.SearchEntryPointOrBuilder getSearchEntryPoi : searchEntryPoint_; } + public static final int GROUNDING_CHUNKS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List groundingChunks_; + /** + * + * + *
+   * List of supporting references retrieved from specified grounding source.
+   * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + @java.lang.Override + public java.util.List getGroundingChunksList() { + return groundingChunks_; + } + /** + * + * + *
+   * List of supporting references retrieved from specified grounding source.
+   * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + @java.lang.Override + public java.util.List + getGroundingChunksOrBuilderList() { + return groundingChunks_; + } + /** + * + * + *
+   * List of supporting references retrieved from specified grounding source.
+   * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + @java.lang.Override + public int getGroundingChunksCount() { + return groundingChunks_.size(); + } + /** + * + * + *
+   * List of supporting references retrieved from specified grounding source.
+   * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunk getGroundingChunks(int index) { + return groundingChunks_.get(index); + } + /** + * + * + *
+   * List of supporting references retrieved from specified grounding source.
+   * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingChunkOrBuilder getGroundingChunksOrBuilder( + int index) { + return groundingChunks_.get(index); + } + + public static final int GROUNDING_SUPPORTS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private java.util.List groundingSupports_; + /** + * + * + *
+   * Optional. List of grounding support.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getGroundingSupportsList() { + return groundingSupports_; + } + /** + * + * + *
+   * Optional. List of grounding support.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getGroundingSupportsOrBuilderList() { + return groundingSupports_; + } + /** + * + * + *
+   * Optional. List of grounding support.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getGroundingSupportsCount() { + return groundingSupports_.size(); + } + /** + * + * + *
+   * Optional. List of grounding support.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingSupport getGroundingSupports(int index) { + return groundingSupports_.get(index); + } + /** + * + * + *
+   * Optional. List of grounding support.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingSupportOrBuilder getGroundingSupportsOrBuilder( + int index) { + return groundingSupports_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -204,6 +360,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(4, getSearchEntryPoint()); } + for (int i = 0; i < groundingChunks_.size(); i++) { + output.writeMessage(5, groundingChunks_.get(i)); + } + for (int i = 0; i < groundingSupports_.size(); i++) { + output.writeMessage(6, groundingSupports_.get(i)); + } getUnknownFields().writeTo(output); } @@ -224,6 +386,13 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getSearchEntryPoint()); } + for (int i = 0; i < groundingChunks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, groundingChunks_.get(i)); + } + for (int i = 0; i < groundingSupports_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(6, groundingSupports_.get(i)); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -245,6 +414,8 @@ public boolean equals(final java.lang.Object obj) { if (hasSearchEntryPoint()) { if (!getSearchEntryPoint().equals(other.getSearchEntryPoint())) return false; } + if (!getGroundingChunksList().equals(other.getGroundingChunksList())) return false; + if (!getGroundingSupportsList().equals(other.getGroundingSupportsList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -264,6 +435,14 @@ public int hashCode() { hash = (37 * hash) + SEARCH_ENTRY_POINT_FIELD_NUMBER; hash = (53 * hash) + getSearchEntryPoint().hashCode(); } + if (getGroundingChunksCount() > 0) { + hash = (37 * hash) + GROUNDING_CHUNKS_FIELD_NUMBER; + hash = (53 * hash) + getGroundingChunksList().hashCode(); + } + if (getGroundingSupportsCount() > 0) { + hash = (37 * hash) + GROUNDING_SUPPORTS_FIELD_NUMBER; + hash = (53 * hash) + getGroundingSupportsList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -405,6 +584,8 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getSearchEntryPointFieldBuilder(); + getGroundingChunksFieldBuilder(); + getGroundingSupportsFieldBuilder(); } } @@ -418,6 +599,20 @@ public Builder clear() { searchEntryPointBuilder_.dispose(); searchEntryPointBuilder_ = null; } + if (groundingChunksBuilder_ == null) { + groundingChunks_ = java.util.Collections.emptyList(); + } else { + groundingChunks_ = null; + groundingChunksBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + if (groundingSupportsBuilder_ == null) { + groundingSupports_ = java.util.Collections.emptyList(); + } else { + groundingSupports_ = null; + groundingSupportsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -445,6 +640,7 @@ public com.google.cloud.vertexai.api.GroundingMetadata build() { public com.google.cloud.vertexai.api.GroundingMetadata buildPartial() { com.google.cloud.vertexai.api.GroundingMetadata result = new com.google.cloud.vertexai.api.GroundingMetadata(this); + buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } @@ -452,6 +648,28 @@ public com.google.cloud.vertexai.api.GroundingMetadata buildPartial() { return result; } + private void buildPartialRepeatedFields( + com.google.cloud.vertexai.api.GroundingMetadata result) { + if (groundingChunksBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + groundingChunks_ = java.util.Collections.unmodifiableList(groundingChunks_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.groundingChunks_ = groundingChunks_; + } else { + result.groundingChunks_ = groundingChunksBuilder_.build(); + } + if (groundingSupportsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + groundingSupports_ = java.util.Collections.unmodifiableList(groundingSupports_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.groundingSupports_ = groundingSupports_; + } else { + result.groundingSupports_ = groundingSupportsBuilder_.build(); + } + } + private void buildPartial0(com.google.cloud.vertexai.api.GroundingMetadata result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { @@ -526,6 +744,60 @@ public Builder mergeFrom(com.google.cloud.vertexai.api.GroundingMetadata other) if (other.hasSearchEntryPoint()) { mergeSearchEntryPoint(other.getSearchEntryPoint()); } + if (groundingChunksBuilder_ == null) { + if (!other.groundingChunks_.isEmpty()) { + if (groundingChunks_.isEmpty()) { + groundingChunks_ = other.groundingChunks_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureGroundingChunksIsMutable(); + groundingChunks_.addAll(other.groundingChunks_); + } + onChanged(); + } + } else { + if (!other.groundingChunks_.isEmpty()) { + if (groundingChunksBuilder_.isEmpty()) { + groundingChunksBuilder_.dispose(); + groundingChunksBuilder_ = null; + groundingChunks_ = other.groundingChunks_; + bitField0_ = (bitField0_ & ~0x00000004); + groundingChunksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGroundingChunksFieldBuilder() + : null; + } else { + groundingChunksBuilder_.addAllMessages(other.groundingChunks_); + } + } + } + if (groundingSupportsBuilder_ == null) { + if (!other.groundingSupports_.isEmpty()) { + if (groundingSupports_.isEmpty()) { + groundingSupports_ = other.groundingSupports_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureGroundingSupportsIsMutable(); + groundingSupports_.addAll(other.groundingSupports_); + } + onChanged(); + } + } else { + if (!other.groundingSupports_.isEmpty()) { + if (groundingSupportsBuilder_.isEmpty()) { + groundingSupportsBuilder_.dispose(); + groundingSupportsBuilder_ = null; + groundingSupports_ = other.groundingSupports_; + bitField0_ = (bitField0_ & ~0x00000008); + groundingSupportsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGroundingSupportsFieldBuilder() + : null; + } else { + groundingSupportsBuilder_.addAllMessages(other.groundingSupports_); + } + } + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -566,6 +838,32 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 34 + case 42: + { + com.google.cloud.vertexai.api.GroundingChunk m = + input.readMessage( + com.google.cloud.vertexai.api.GroundingChunk.parser(), extensionRegistry); + if (groundingChunksBuilder_ == null) { + ensureGroundingChunksIsMutable(); + groundingChunks_.add(m); + } else { + groundingChunksBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: + { + com.google.cloud.vertexai.api.GroundingSupport m = + input.readMessage( + com.google.cloud.vertexai.api.GroundingSupport.parser(), extensionRegistry); + if (groundingSupportsBuilder_ == null) { + ensureGroundingSupportsIsMutable(); + groundingSupports_.add(m); + } else { + groundingSupportsBuilder_.addMessage(m); + } + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -973,6 +1271,762 @@ public com.google.cloud.vertexai.api.SearchEntryPointOrBuilder getSearchEntryPoi return searchEntryPointBuilder_; } + private java.util.List groundingChunks_ = + java.util.Collections.emptyList(); + + private void ensureGroundingChunksIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + groundingChunks_ = + new java.util.ArrayList(groundingChunks_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.GroundingChunk, + com.google.cloud.vertexai.api.GroundingChunk.Builder, + com.google.cloud.vertexai.api.GroundingChunkOrBuilder> + groundingChunksBuilder_; + + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public java.util.List getGroundingChunksList() { + if (groundingChunksBuilder_ == null) { + return java.util.Collections.unmodifiableList(groundingChunks_); + } else { + return groundingChunksBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public int getGroundingChunksCount() { + if (groundingChunksBuilder_ == null) { + return groundingChunks_.size(); + } else { + return groundingChunksBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public com.google.cloud.vertexai.api.GroundingChunk getGroundingChunks(int index) { + if (groundingChunksBuilder_ == null) { + return groundingChunks_.get(index); + } else { + return groundingChunksBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public Builder setGroundingChunks( + int index, com.google.cloud.vertexai.api.GroundingChunk value) { + if (groundingChunksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroundingChunksIsMutable(); + groundingChunks_.set(index, value); + onChanged(); + } else { + groundingChunksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public Builder setGroundingChunks( + int index, com.google.cloud.vertexai.api.GroundingChunk.Builder builderForValue) { + if (groundingChunksBuilder_ == null) { + ensureGroundingChunksIsMutable(); + groundingChunks_.set(index, builderForValue.build()); + onChanged(); + } else { + groundingChunksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public Builder addGroundingChunks(com.google.cloud.vertexai.api.GroundingChunk value) { + if (groundingChunksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroundingChunksIsMutable(); + groundingChunks_.add(value); + onChanged(); + } else { + groundingChunksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public Builder addGroundingChunks( + int index, com.google.cloud.vertexai.api.GroundingChunk value) { + if (groundingChunksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroundingChunksIsMutable(); + groundingChunks_.add(index, value); + onChanged(); + } else { + groundingChunksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public Builder addGroundingChunks( + com.google.cloud.vertexai.api.GroundingChunk.Builder builderForValue) { + if (groundingChunksBuilder_ == null) { + ensureGroundingChunksIsMutable(); + groundingChunks_.add(builderForValue.build()); + onChanged(); + } else { + groundingChunksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public Builder addGroundingChunks( + int index, com.google.cloud.vertexai.api.GroundingChunk.Builder builderForValue) { + if (groundingChunksBuilder_ == null) { + ensureGroundingChunksIsMutable(); + groundingChunks_.add(index, builderForValue.build()); + onChanged(); + } else { + groundingChunksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public Builder addAllGroundingChunks( + java.lang.Iterable values) { + if (groundingChunksBuilder_ == null) { + ensureGroundingChunksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, groundingChunks_); + onChanged(); + } else { + groundingChunksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public Builder clearGroundingChunks() { + if (groundingChunksBuilder_ == null) { + groundingChunks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + groundingChunksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public Builder removeGroundingChunks(int index) { + if (groundingChunksBuilder_ == null) { + ensureGroundingChunksIsMutable(); + groundingChunks_.remove(index); + onChanged(); + } else { + groundingChunksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public com.google.cloud.vertexai.api.GroundingChunk.Builder getGroundingChunksBuilder( + int index) { + return getGroundingChunksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public com.google.cloud.vertexai.api.GroundingChunkOrBuilder getGroundingChunksOrBuilder( + int index) { + if (groundingChunksBuilder_ == null) { + return groundingChunks_.get(index); + } else { + return groundingChunksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public java.util.List + getGroundingChunksOrBuilderList() { + if (groundingChunksBuilder_ != null) { + return groundingChunksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(groundingChunks_); + } + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public com.google.cloud.vertexai.api.GroundingChunk.Builder addGroundingChunksBuilder() { + return getGroundingChunksFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.GroundingChunk.getDefaultInstance()); + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public com.google.cloud.vertexai.api.GroundingChunk.Builder addGroundingChunksBuilder( + int index) { + return getGroundingChunksFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.GroundingChunk.getDefaultInstance()); + } + /** + * + * + *
+     * List of supporting references retrieved from specified grounding source.
+     * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + public java.util.List + getGroundingChunksBuilderList() { + return getGroundingChunksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.GroundingChunk, + com.google.cloud.vertexai.api.GroundingChunk.Builder, + com.google.cloud.vertexai.api.GroundingChunkOrBuilder> + getGroundingChunksFieldBuilder() { + if (groundingChunksBuilder_ == null) { + groundingChunksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.GroundingChunk, + com.google.cloud.vertexai.api.GroundingChunk.Builder, + com.google.cloud.vertexai.api.GroundingChunkOrBuilder>( + groundingChunks_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + groundingChunks_ = null; + } + return groundingChunksBuilder_; + } + + private java.util.List groundingSupports_ = + java.util.Collections.emptyList(); + + private void ensureGroundingSupportsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + groundingSupports_ = + new java.util.ArrayList( + groundingSupports_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.GroundingSupport, + com.google.cloud.vertexai.api.GroundingSupport.Builder, + com.google.cloud.vertexai.api.GroundingSupportOrBuilder> + groundingSupportsBuilder_; + + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getGroundingSupportsList() { + if (groundingSupportsBuilder_ == null) { + return java.util.Collections.unmodifiableList(groundingSupports_); + } else { + return groundingSupportsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getGroundingSupportsCount() { + if (groundingSupportsBuilder_ == null) { + return groundingSupports_.size(); + } else { + return groundingSupportsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.GroundingSupport getGroundingSupports(int index) { + if (groundingSupportsBuilder_ == null) { + return groundingSupports_.get(index); + } else { + return groundingSupportsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGroundingSupports( + int index, com.google.cloud.vertexai.api.GroundingSupport value) { + if (groundingSupportsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroundingSupportsIsMutable(); + groundingSupports_.set(index, value); + onChanged(); + } else { + groundingSupportsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGroundingSupports( + int index, com.google.cloud.vertexai.api.GroundingSupport.Builder builderForValue) { + if (groundingSupportsBuilder_ == null) { + ensureGroundingSupportsIsMutable(); + groundingSupports_.set(index, builderForValue.build()); + onChanged(); + } else { + groundingSupportsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addGroundingSupports(com.google.cloud.vertexai.api.GroundingSupport value) { + if (groundingSupportsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroundingSupportsIsMutable(); + groundingSupports_.add(value); + onChanged(); + } else { + groundingSupportsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addGroundingSupports( + int index, com.google.cloud.vertexai.api.GroundingSupport value) { + if (groundingSupportsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroundingSupportsIsMutable(); + groundingSupports_.add(index, value); + onChanged(); + } else { + groundingSupportsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addGroundingSupports( + com.google.cloud.vertexai.api.GroundingSupport.Builder builderForValue) { + if (groundingSupportsBuilder_ == null) { + ensureGroundingSupportsIsMutable(); + groundingSupports_.add(builderForValue.build()); + onChanged(); + } else { + groundingSupportsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addGroundingSupports( + int index, com.google.cloud.vertexai.api.GroundingSupport.Builder builderForValue) { + if (groundingSupportsBuilder_ == null) { + ensureGroundingSupportsIsMutable(); + groundingSupports_.add(index, builderForValue.build()); + onChanged(); + } else { + groundingSupportsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllGroundingSupports( + java.lang.Iterable values) { + if (groundingSupportsBuilder_ == null) { + ensureGroundingSupportsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, groundingSupports_); + onChanged(); + } else { + groundingSupportsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearGroundingSupports() { + if (groundingSupportsBuilder_ == null) { + groundingSupports_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + groundingSupportsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeGroundingSupports(int index) { + if (groundingSupportsBuilder_ == null) { + ensureGroundingSupportsIsMutable(); + groundingSupports_.remove(index); + onChanged(); + } else { + groundingSupportsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.GroundingSupport.Builder getGroundingSupportsBuilder( + int index) { + return getGroundingSupportsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.GroundingSupportOrBuilder getGroundingSupportsOrBuilder( + int index) { + if (groundingSupportsBuilder_ == null) { + return groundingSupports_.get(index); + } else { + return groundingSupportsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getGroundingSupportsOrBuilderList() { + if (groundingSupportsBuilder_ != null) { + return groundingSupportsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(groundingSupports_); + } + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.GroundingSupport.Builder addGroundingSupportsBuilder() { + return getGroundingSupportsFieldBuilder() + .addBuilder(com.google.cloud.vertexai.api.GroundingSupport.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.GroundingSupport.Builder addGroundingSupportsBuilder( + int index) { + return getGroundingSupportsFieldBuilder() + .addBuilder(index, com.google.cloud.vertexai.api.GroundingSupport.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. List of grounding support.
+     * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getGroundingSupportsBuilderList() { + return getGroundingSupportsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.GroundingSupport, + com.google.cloud.vertexai.api.GroundingSupport.Builder, + com.google.cloud.vertexai.api.GroundingSupportOrBuilder> + getGroundingSupportsFieldBuilder() { + if (groundingSupportsBuilder_ == null) { + groundingSupportsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.vertexai.api.GroundingSupport, + com.google.cloud.vertexai.api.GroundingSupport.Builder, + com.google.cloud.vertexai.api.GroundingSupportOrBuilder>( + groundingSupports_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + groundingSupports_ = null; + } + return groundingSupportsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingMetadataOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingMetadataOrBuilder.java index e1f581c410af..3aff64d8c1e6 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingMetadataOrBuilder.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingMetadataOrBuilder.java @@ -115,4 +115,118 @@ public interface GroundingMetadataOrBuilder * */ com.google.cloud.vertexai.api.SearchEntryPointOrBuilder getSearchEntryPointOrBuilder(); + + /** + * + * + *
+   * List of supporting references retrieved from specified grounding source.
+   * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + java.util.List getGroundingChunksList(); + /** + * + * + *
+   * List of supporting references retrieved from specified grounding source.
+   * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + com.google.cloud.vertexai.api.GroundingChunk getGroundingChunks(int index); + /** + * + * + *
+   * List of supporting references retrieved from specified grounding source.
+   * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + int getGroundingChunksCount(); + /** + * + * + *
+   * List of supporting references retrieved from specified grounding source.
+   * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + java.util.List + getGroundingChunksOrBuilderList(); + /** + * + * + *
+   * List of supporting references retrieved from specified grounding source.
+   * 
+ * + * repeated .google.cloud.vertexai.v1.GroundingChunk grounding_chunks = 5; + */ + com.google.cloud.vertexai.api.GroundingChunkOrBuilder getGroundingChunksOrBuilder(int index); + + /** + * + * + *
+   * Optional. List of grounding support.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getGroundingSupportsList(); + /** + * + * + *
+   * Optional. List of grounding support.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.GroundingSupport getGroundingSupports(int index); + /** + * + * + *
+   * Optional. List of grounding support.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getGroundingSupportsCount(); + /** + * + * + *
+   * Optional. List of grounding support.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getGroundingSupportsOrBuilderList(); + /** + * + * + *
+   * Optional. List of grounding support.
+   * 
+ * + * + * repeated .google.cloud.vertexai.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.GroundingSupportOrBuilder getGroundingSupportsOrBuilder(int index); } diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingSupport.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingSupport.java new file mode 100644 index 000000000000..ea967a3eddd9 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingSupport.java @@ -0,0 +1,1257 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1/content.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Grounding support.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.GroundingSupport} + */ +public final class GroundingSupport extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1.GroundingSupport) + GroundingSupportOrBuilder { + private static final long serialVersionUID = 0L; + // Use GroundingSupport.newBuilder() to construct. + private GroundingSupport(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GroundingSupport() { + groundingChunkIndices_ = emptyIntList(); + confidenceScores_ = emptyFloatList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GroundingSupport(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingSupport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingSupport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GroundingSupport.class, + com.google.cloud.vertexai.api.GroundingSupport.Builder.class); + } + + private int bitField0_; + public static final int SEGMENT_FIELD_NUMBER = 1; + private com.google.cloud.vertexai.api.Segment segment_; + /** + * + * + *
+   * Segment of the content this support belongs to.
+   * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + * + * @return Whether the segment field is set. + */ + @java.lang.Override + public boolean hasSegment() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Segment of the content this support belongs to.
+   * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + * + * @return The segment. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.Segment getSegment() { + return segment_ == null ? com.google.cloud.vertexai.api.Segment.getDefaultInstance() : segment_; + } + /** + * + * + *
+   * Segment of the content this support belongs to.
+   * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + */ + @java.lang.Override + public com.google.cloud.vertexai.api.SegmentOrBuilder getSegmentOrBuilder() { + return segment_ == null ? com.google.cloud.vertexai.api.Segment.getDefaultInstance() : segment_; + } + + public static final int GROUNDING_CHUNK_INDICES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList groundingChunkIndices_ = emptyIntList(); + /** + * + * + *
+   * A list of indices (into 'grounding_chunk') specifying the
+   * citations associated with the claim. For instance [1,3,4] means
+   * that grounding_chunk[1], grounding_chunk[3],
+   * grounding_chunk[4] are the retrieved content attributed to the claim.
+   * 
+ * + * repeated int32 grounding_chunk_indices = 2; + * + * @return A list containing the groundingChunkIndices. + */ + @java.lang.Override + public java.util.List getGroundingChunkIndicesList() { + return groundingChunkIndices_; + } + /** + * + * + *
+   * A list of indices (into 'grounding_chunk') specifying the
+   * citations associated with the claim. For instance [1,3,4] means
+   * that grounding_chunk[1], grounding_chunk[3],
+   * grounding_chunk[4] are the retrieved content attributed to the claim.
+   * 
+ * + * repeated int32 grounding_chunk_indices = 2; + * + * @return The count of groundingChunkIndices. + */ + public int getGroundingChunkIndicesCount() { + return groundingChunkIndices_.size(); + } + /** + * + * + *
+   * A list of indices (into 'grounding_chunk') specifying the
+   * citations associated with the claim. For instance [1,3,4] means
+   * that grounding_chunk[1], grounding_chunk[3],
+   * grounding_chunk[4] are the retrieved content attributed to the claim.
+   * 
+ * + * repeated int32 grounding_chunk_indices = 2; + * + * @param index The index of the element to return. + * @return The groundingChunkIndices at the given index. + */ + public int getGroundingChunkIndices(int index) { + return groundingChunkIndices_.getInt(index); + } + + private int groundingChunkIndicesMemoizedSerializedSize = -1; + + public static final int CONFIDENCE_SCORES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList confidenceScores_ = emptyFloatList(); + /** + * + * + *
+   * Confidence score of the support references. Ranges from 0 to 1. 1 is the
+   * most confident. This list must have the same size as the
+   * grounding_chunk_indices.
+   * 
+ * + * repeated float confidence_scores = 3; + * + * @return A list containing the confidenceScores. + */ + @java.lang.Override + public java.util.List getConfidenceScoresList() { + return confidenceScores_; + } + /** + * + * + *
+   * Confidence score of the support references. Ranges from 0 to 1. 1 is the
+   * most confident. This list must have the same size as the
+   * grounding_chunk_indices.
+   * 
+ * + * repeated float confidence_scores = 3; + * + * @return The count of confidenceScores. + */ + public int getConfidenceScoresCount() { + return confidenceScores_.size(); + } + /** + * + * + *
+   * Confidence score of the support references. Ranges from 0 to 1. 1 is the
+   * most confident. This list must have the same size as the
+   * grounding_chunk_indices.
+   * 
+ * + * repeated float confidence_scores = 3; + * + * @param index The index of the element to return. + * @return The confidenceScores at the given index. + */ + public float getConfidenceScores(int index) { + return confidenceScores_.getFloat(index); + } + + private int confidenceScoresMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getSegment()); + } + if (getGroundingChunkIndicesList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(groundingChunkIndicesMemoizedSerializedSize); + } + for (int i = 0; i < groundingChunkIndices_.size(); i++) { + output.writeInt32NoTag(groundingChunkIndices_.getInt(i)); + } + if (getConfidenceScoresList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(confidenceScoresMemoizedSerializedSize); + } + for (int i = 0; i < confidenceScores_.size(); i++) { + output.writeFloatNoTag(confidenceScores_.getFloat(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSegment()); + } + { + int dataSize = 0; + for (int i = 0; i < groundingChunkIndices_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag( + groundingChunkIndices_.getInt(i)); + } + size += dataSize; + if (!getGroundingChunkIndicesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + groundingChunkIndicesMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 4 * getConfidenceScoresList().size(); + size += dataSize; + if (!getConfidenceScoresList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + confidenceScoresMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.GroundingSupport)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.GroundingSupport other = + (com.google.cloud.vertexai.api.GroundingSupport) obj; + + if (hasSegment() != other.hasSegment()) return false; + if (hasSegment()) { + if (!getSegment().equals(other.getSegment())) return false; + } + if (!getGroundingChunkIndicesList().equals(other.getGroundingChunkIndicesList())) return false; + if (!getConfidenceScoresList().equals(other.getConfidenceScoresList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSegment()) { + hash = (37 * hash) + SEGMENT_FIELD_NUMBER; + hash = (53 * hash) + getSegment().hashCode(); + } + if (getGroundingChunkIndicesCount() > 0) { + hash = (37 * hash) + GROUNDING_CHUNK_INDICES_FIELD_NUMBER; + hash = (53 * hash) + getGroundingChunkIndicesList().hashCode(); + } + if (getConfidenceScoresCount() > 0) { + hash = (37 * hash) + CONFIDENCE_SCORES_FIELD_NUMBER; + hash = (53 * hash) + getConfidenceScoresList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.GroundingSupport parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GroundingSupport parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingSupport parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GroundingSupport parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingSupport parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.GroundingSupport parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingSupport parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GroundingSupport parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingSupport parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GroundingSupport parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.GroundingSupport parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.GroundingSupport parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.GroundingSupport prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Grounding support.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.GroundingSupport} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1.GroundingSupport) + com.google.cloud.vertexai.api.GroundingSupportOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingSupport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingSupport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.GroundingSupport.class, + com.google.cloud.vertexai.api.GroundingSupport.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.GroundingSupport.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSegmentFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + segment_ = null; + if (segmentBuilder_ != null) { + segmentBuilder_.dispose(); + segmentBuilder_ = null; + } + groundingChunkIndices_ = emptyIntList(); + confidenceScores_ = emptyFloatList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_GroundingSupport_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingSupport getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.GroundingSupport.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingSupport build() { + com.google.cloud.vertexai.api.GroundingSupport result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingSupport buildPartial() { + com.google.cloud.vertexai.api.GroundingSupport result = + new com.google.cloud.vertexai.api.GroundingSupport(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.GroundingSupport result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.segment_ = segmentBuilder_ == null ? segment_ : segmentBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + groundingChunkIndices_.makeImmutable(); + result.groundingChunkIndices_ = groundingChunkIndices_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + confidenceScores_.makeImmutable(); + result.confidenceScores_ = confidenceScores_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.GroundingSupport) { + return mergeFrom((com.google.cloud.vertexai.api.GroundingSupport) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.GroundingSupport other) { + if (other == com.google.cloud.vertexai.api.GroundingSupport.getDefaultInstance()) return this; + if (other.hasSegment()) { + mergeSegment(other.getSegment()); + } + if (!other.groundingChunkIndices_.isEmpty()) { + if (groundingChunkIndices_.isEmpty()) { + groundingChunkIndices_ = other.groundingChunkIndices_; + groundingChunkIndices_.makeImmutable(); + bitField0_ |= 0x00000002; + } else { + ensureGroundingChunkIndicesIsMutable(); + groundingChunkIndices_.addAll(other.groundingChunkIndices_); + } + onChanged(); + } + if (!other.confidenceScores_.isEmpty()) { + if (confidenceScores_.isEmpty()) { + confidenceScores_ = other.confidenceScores_; + confidenceScores_.makeImmutable(); + bitField0_ |= 0x00000004; + } else { + ensureConfidenceScoresIsMutable(); + confidenceScores_.addAll(other.confidenceScores_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getSegmentFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + int v = input.readInt32(); + ensureGroundingChunkIndicesIsMutable(); + groundingChunkIndices_.addInt(v); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureGroundingChunkIndicesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + groundingChunkIndices_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 18 + case 29: + { + float v = input.readFloat(); + ensureConfidenceScoresIsMutable(); + confidenceScores_.addFloat(v); + break; + } // case 29 + case 26: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureConfidenceScoresIsMutable(alloc / 4); + while (input.getBytesUntilLimit() > 0) { + confidenceScores_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.vertexai.api.Segment segment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Segment, + com.google.cloud.vertexai.api.Segment.Builder, + com.google.cloud.vertexai.api.SegmentOrBuilder> + segmentBuilder_; + /** + * + * + *
+     * Segment of the content this support belongs to.
+     * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + * + * @return Whether the segment field is set. + */ + public boolean hasSegment() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Segment of the content this support belongs to.
+     * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + * + * @return The segment. + */ + public com.google.cloud.vertexai.api.Segment getSegment() { + if (segmentBuilder_ == null) { + return segment_ == null + ? com.google.cloud.vertexai.api.Segment.getDefaultInstance() + : segment_; + } else { + return segmentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Segment of the content this support belongs to.
+     * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + */ + public Builder setSegment(com.google.cloud.vertexai.api.Segment value) { + if (segmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + segment_ = value; + } else { + segmentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Segment of the content this support belongs to.
+     * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + */ + public Builder setSegment(com.google.cloud.vertexai.api.Segment.Builder builderForValue) { + if (segmentBuilder_ == null) { + segment_ = builderForValue.build(); + } else { + segmentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Segment of the content this support belongs to.
+     * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + */ + public Builder mergeSegment(com.google.cloud.vertexai.api.Segment value) { + if (segmentBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && segment_ != null + && segment_ != com.google.cloud.vertexai.api.Segment.getDefaultInstance()) { + getSegmentBuilder().mergeFrom(value); + } else { + segment_ = value; + } + } else { + segmentBuilder_.mergeFrom(value); + } + if (segment_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Segment of the content this support belongs to.
+     * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + */ + public Builder clearSegment() { + bitField0_ = (bitField0_ & ~0x00000001); + segment_ = null; + if (segmentBuilder_ != null) { + segmentBuilder_.dispose(); + segmentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Segment of the content this support belongs to.
+     * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + */ + public com.google.cloud.vertexai.api.Segment.Builder getSegmentBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSegmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Segment of the content this support belongs to.
+     * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + */ + public com.google.cloud.vertexai.api.SegmentOrBuilder getSegmentOrBuilder() { + if (segmentBuilder_ != null) { + return segmentBuilder_.getMessageOrBuilder(); + } else { + return segment_ == null + ? com.google.cloud.vertexai.api.Segment.getDefaultInstance() + : segment_; + } + } + /** + * + * + *
+     * Segment of the content this support belongs to.
+     * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Segment, + com.google.cloud.vertexai.api.Segment.Builder, + com.google.cloud.vertexai.api.SegmentOrBuilder> + getSegmentFieldBuilder() { + if (segmentBuilder_ == null) { + segmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.Segment, + com.google.cloud.vertexai.api.Segment.Builder, + com.google.cloud.vertexai.api.SegmentOrBuilder>( + getSegment(), getParentForChildren(), isClean()); + segment_ = null; + } + return segmentBuilder_; + } + + private com.google.protobuf.Internal.IntList groundingChunkIndices_ = emptyIntList(); + + private void ensureGroundingChunkIndicesIsMutable() { + if (!groundingChunkIndices_.isModifiable()) { + groundingChunkIndices_ = makeMutableCopy(groundingChunkIndices_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+     * A list of indices (into 'grounding_chunk') specifying the
+     * citations associated with the claim. For instance [1,3,4] means
+     * that grounding_chunk[1], grounding_chunk[3],
+     * grounding_chunk[4] are the retrieved content attributed to the claim.
+     * 
+ * + * repeated int32 grounding_chunk_indices = 2; + * + * @return A list containing the groundingChunkIndices. + */ + public java.util.List getGroundingChunkIndicesList() { + groundingChunkIndices_.makeImmutable(); + return groundingChunkIndices_; + } + /** + * + * + *
+     * A list of indices (into 'grounding_chunk') specifying the
+     * citations associated with the claim. For instance [1,3,4] means
+     * that grounding_chunk[1], grounding_chunk[3],
+     * grounding_chunk[4] are the retrieved content attributed to the claim.
+     * 
+ * + * repeated int32 grounding_chunk_indices = 2; + * + * @return The count of groundingChunkIndices. + */ + public int getGroundingChunkIndicesCount() { + return groundingChunkIndices_.size(); + } + /** + * + * + *
+     * A list of indices (into 'grounding_chunk') specifying the
+     * citations associated with the claim. For instance [1,3,4] means
+     * that grounding_chunk[1], grounding_chunk[3],
+     * grounding_chunk[4] are the retrieved content attributed to the claim.
+     * 
+ * + * repeated int32 grounding_chunk_indices = 2; + * + * @param index The index of the element to return. + * @return The groundingChunkIndices at the given index. + */ + public int getGroundingChunkIndices(int index) { + return groundingChunkIndices_.getInt(index); + } + /** + * + * + *
+     * A list of indices (into 'grounding_chunk') specifying the
+     * citations associated with the claim. For instance [1,3,4] means
+     * that grounding_chunk[1], grounding_chunk[3],
+     * grounding_chunk[4] are the retrieved content attributed to the claim.
+     * 
+ * + * repeated int32 grounding_chunk_indices = 2; + * + * @param index The index to set the value at. + * @param value The groundingChunkIndices to set. + * @return This builder for chaining. + */ + public Builder setGroundingChunkIndices(int index, int value) { + + ensureGroundingChunkIndicesIsMutable(); + groundingChunkIndices_.setInt(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A list of indices (into 'grounding_chunk') specifying the
+     * citations associated with the claim. For instance [1,3,4] means
+     * that grounding_chunk[1], grounding_chunk[3],
+     * grounding_chunk[4] are the retrieved content attributed to the claim.
+     * 
+ * + * repeated int32 grounding_chunk_indices = 2; + * + * @param value The groundingChunkIndices to add. + * @return This builder for chaining. + */ + public Builder addGroundingChunkIndices(int value) { + + ensureGroundingChunkIndicesIsMutable(); + groundingChunkIndices_.addInt(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A list of indices (into 'grounding_chunk') specifying the
+     * citations associated with the claim. For instance [1,3,4] means
+     * that grounding_chunk[1], grounding_chunk[3],
+     * grounding_chunk[4] are the retrieved content attributed to the claim.
+     * 
+ * + * repeated int32 grounding_chunk_indices = 2; + * + * @param values The groundingChunkIndices to add. + * @return This builder for chaining. + */ + public Builder addAllGroundingChunkIndices( + java.lang.Iterable values) { + ensureGroundingChunkIndicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, groundingChunkIndices_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A list of indices (into 'grounding_chunk') specifying the
+     * citations associated with the claim. For instance [1,3,4] means
+     * that grounding_chunk[1], grounding_chunk[3],
+     * grounding_chunk[4] are the retrieved content attributed to the claim.
+     * 
+ * + * repeated int32 grounding_chunk_indices = 2; + * + * @return This builder for chaining. + */ + public Builder clearGroundingChunkIndices() { + groundingChunkIndices_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.FloatList confidenceScores_ = emptyFloatList(); + + private void ensureConfidenceScoresIsMutable() { + if (!confidenceScores_.isModifiable()) { + confidenceScores_ = makeMutableCopy(confidenceScores_); + } + bitField0_ |= 0x00000004; + } + + private void ensureConfidenceScoresIsMutable(int capacity) { + if (!confidenceScores_.isModifiable()) { + confidenceScores_ = makeMutableCopy(confidenceScores_, capacity); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Confidence score of the support references. Ranges from 0 to 1. 1 is the
+     * most confident. This list must have the same size as the
+     * grounding_chunk_indices.
+     * 
+ * + * repeated float confidence_scores = 3; + * + * @return A list containing the confidenceScores. + */ + public java.util.List getConfidenceScoresList() { + confidenceScores_.makeImmutable(); + return confidenceScores_; + } + /** + * + * + *
+     * Confidence score of the support references. Ranges from 0 to 1. 1 is the
+     * most confident. This list must have the same size as the
+     * grounding_chunk_indices.
+     * 
+ * + * repeated float confidence_scores = 3; + * + * @return The count of confidenceScores. + */ + public int getConfidenceScoresCount() { + return confidenceScores_.size(); + } + /** + * + * + *
+     * Confidence score of the support references. Ranges from 0 to 1. 1 is the
+     * most confident. This list must have the same size as the
+     * grounding_chunk_indices.
+     * 
+ * + * repeated float confidence_scores = 3; + * + * @param index The index of the element to return. + * @return The confidenceScores at the given index. + */ + public float getConfidenceScores(int index) { + return confidenceScores_.getFloat(index); + } + /** + * + * + *
+     * Confidence score of the support references. Ranges from 0 to 1. 1 is the
+     * most confident. This list must have the same size as the
+     * grounding_chunk_indices.
+     * 
+ * + * repeated float confidence_scores = 3; + * + * @param index The index to set the value at. + * @param value The confidenceScores to set. + * @return This builder for chaining. + */ + public Builder setConfidenceScores(int index, float value) { + + ensureConfidenceScoresIsMutable(); + confidenceScores_.setFloat(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Confidence score of the support references. Ranges from 0 to 1. 1 is the
+     * most confident. This list must have the same size as the
+     * grounding_chunk_indices.
+     * 
+ * + * repeated float confidence_scores = 3; + * + * @param value The confidenceScores to add. + * @return This builder for chaining. + */ + public Builder addConfidenceScores(float value) { + + ensureConfidenceScoresIsMutable(); + confidenceScores_.addFloat(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Confidence score of the support references. Ranges from 0 to 1. 1 is the
+     * most confident. This list must have the same size as the
+     * grounding_chunk_indices.
+     * 
+ * + * repeated float confidence_scores = 3; + * + * @param values The confidenceScores to add. + * @return This builder for chaining. + */ + public Builder addAllConfidenceScores(java.lang.Iterable values) { + ensureConfidenceScoresIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, confidenceScores_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Confidence score of the support references. Ranges from 0 to 1. 1 is the
+     * most confident. This list must have the same size as the
+     * grounding_chunk_indices.
+     * 
+ * + * repeated float confidence_scores = 3; + * + * @return This builder for chaining. + */ + public Builder clearConfidenceScores() { + confidenceScores_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1.GroundingSupport) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1.GroundingSupport) + private static final com.google.cloud.vertexai.api.GroundingSupport DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.GroundingSupport(); + } + + public static com.google.cloud.vertexai.api.GroundingSupport getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GroundingSupport parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.GroundingSupport getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingSupportOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingSupportOrBuilder.java new file mode 100644 index 000000000000..352867807c2e --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/GroundingSupportOrBuilder.java @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1/content.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.vertexai.api; + +public interface GroundingSupportOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1.GroundingSupport) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Segment of the content this support belongs to.
+   * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + * + * @return Whether the segment field is set. + */ + boolean hasSegment(); + /** + * + * + *
+   * Segment of the content this support belongs to.
+   * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + * + * @return The segment. + */ + com.google.cloud.vertexai.api.Segment getSegment(); + /** + * + * + *
+   * Segment of the content this support belongs to.
+   * 
+ * + * optional .google.cloud.vertexai.v1.Segment segment = 1; + */ + com.google.cloud.vertexai.api.SegmentOrBuilder getSegmentOrBuilder(); + + /** + * + * + *
+   * A list of indices (into 'grounding_chunk') specifying the
+   * citations associated with the claim. For instance [1,3,4] means
+   * that grounding_chunk[1], grounding_chunk[3],
+   * grounding_chunk[4] are the retrieved content attributed to the claim.
+   * 
+ * + * repeated int32 grounding_chunk_indices = 2; + * + * @return A list containing the groundingChunkIndices. + */ + java.util.List getGroundingChunkIndicesList(); + /** + * + * + *
+   * A list of indices (into 'grounding_chunk') specifying the
+   * citations associated with the claim. For instance [1,3,4] means
+   * that grounding_chunk[1], grounding_chunk[3],
+   * grounding_chunk[4] are the retrieved content attributed to the claim.
+   * 
+ * + * repeated int32 grounding_chunk_indices = 2; + * + * @return The count of groundingChunkIndices. + */ + int getGroundingChunkIndicesCount(); + /** + * + * + *
+   * A list of indices (into 'grounding_chunk') specifying the
+   * citations associated with the claim. For instance [1,3,4] means
+   * that grounding_chunk[1], grounding_chunk[3],
+   * grounding_chunk[4] are the retrieved content attributed to the claim.
+   * 
+ * + * repeated int32 grounding_chunk_indices = 2; + * + * @param index The index of the element to return. + * @return The groundingChunkIndices at the given index. + */ + int getGroundingChunkIndices(int index); + + /** + * + * + *
+   * Confidence score of the support references. Ranges from 0 to 1. 1 is the
+   * most confident. This list must have the same size as the
+   * grounding_chunk_indices.
+   * 
+ * + * repeated float confidence_scores = 3; + * + * @return A list containing the confidenceScores. + */ + java.util.List getConfidenceScoresList(); + /** + * + * + *
+   * Confidence score of the support references. Ranges from 0 to 1. 1 is the
+   * most confident. This list must have the same size as the
+   * grounding_chunk_indices.
+   * 
+ * + * repeated float confidence_scores = 3; + * + * @return The count of confidenceScores. + */ + int getConfidenceScoresCount(); + /** + * + * + *
+   * Confidence score of the support references. Ranges from 0 to 1. 1 is the
+   * most confident. This list must have the same size as the
+   * grounding_chunk_indices.
+   * 
+ * + * repeated float confidence_scores = 3; + * + * @param index The index of the element to return. + * @return The confidenceScores at the given index. + */ + float getConfidenceScores(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/LlmUtilityServiceProto.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/LlmUtilityServiceProto.java index b3ef2634ce1b..4d84ab7b1fa2 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/LlmUtilityServiceProto.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/LlmUtilityServiceProto.java @@ -53,39 +53,47 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ervice.proto\022\030google.cloud.vertexai.v1\032\034" + "google/api/annotations.proto\032\027google/api" + "/client.proto\032\037google/api/field_behavior" - + ".proto\032\031google/api/resource.proto\0321googl" + + ".proto\032\031google/api/resource.proto\032&googl" + + "e/cloud/vertexai/v1/content.proto\0321googl" + "e/cloud/vertexai/v1/prediction_service.p" - + "roto\032\034google/protobuf/struct.proto\"\204\001\n\024C" + + "roto\032\034google/protobuf/struct.proto\"\322\001\n\024C" + "omputeTokensRequest\022<\n\010endpoint\030\001 \001(\tB*\340" + "A\002\372A$\n\"aiplatform.googleapis.com/Endpoin" + "t\022.\n\tinstances\030\002 \003(\0132\026.google.protobuf.V" - + "alueB\003\340A\002\"/\n\nTokensInfo\022\016\n\006tokens\030\001 \003(\014\022" - + "\021\n\ttoken_ids\030\002 \003(\003\"R\n\025ComputeTokensRespo" - + "nse\0229\n\013tokens_info\030\001 \003(\0132$.google.cloud." - + "vertexai.v1.TokensInfo2\244\005\n\021LlmUtilitySer" - + "vice\022\231\002\n\013CountTokens\022,.google.cloud.vert" - + "exai.v1.CountTokensRequest\032-.google.clou" - + "d.vertexai.v1.CountTokensResponse\"\254\001\332A\022e" - + "ndpoint,instances\202\323\344\223\002\220\001\"=/v1/{endpoint=" - + "projects/*/locations/*/endpoints/*}:coun" - + "tTokens:\001*ZL\"G/v1/{endpoint=projects/*/l" - + "ocations/*/publishers/*/models/*}:countT" - + "okens:\001*\022\243\002\n\rComputeTokens\022..google.clou" - + "d.vertexai.v1.ComputeTokensRequest\032/.goo" - + "gle.cloud.vertexai.v1.ComputeTokensRespo" - + "nse\"\260\001\332A\022endpoint,instances\202\323\344\223\002\224\001\"?/v1/" - + "{endpoint=projects/*/locations/*/endpoin" - + "ts/*}:computeTokens:\001*ZN\"I/v1/{endpoint=" - + "projects/*/locations/*/publishers/*/mode" - + "ls/*}:computeTokens:\001*\032M\312A\031aiplatform.go" - + "ogleapis.com\322A.https://www.googleapis.co" - + "m/auth/cloud-platformB\323\001\n\035com.google.clo" - + "ud.vertexai.apiB\026LlmUtilityServiceProtoP" - + "\001Z>cloud.google.com/go/aiplatform/apiv1/" - + "aiplatformpb;aiplatformpb\252\002\032Google.Cloud" - + ".AIPlatform.V1\312\002\032Google\\Cloud\\AIPlatform" - + "\\V1\352\002\035Google::Cloud::AIPlatform::V1b\006pro" - + "to3" + + "alueB\003\340A\001\022\022\n\005model\030\003 \001(\tB\003\340A\001\0228\n\010content" + + "s\030\004 \003(\0132!.google.cloud.vertexai.v1.Conte" + + "ntB\003\340A\001\"B\n\nTokensInfo\022\016\n\006tokens\030\001 \003(\014\022\021\n" + + "\ttoken_ids\030\002 \003(\003\022\021\n\004role\030\003 \001(\tB\003\340A\001\"R\n\025C" + + "omputeTokensResponse\0229\n\013tokens_info\030\001 \003(" + + "\0132$.google.cloud.vertexai.v1.TokensInfo2" + + "\360\006\n\021LlmUtilityService\022\375\002\n\013CountTokens\022,." + + "google.cloud.vertexai.v1.CountTokensRequ" + + "est\032-.google.cloud.vertexai.v1.CountToke" + + "nsResponse\"\220\002\332A\022endpoint,instances\202\323\344\223\002\364" + + "\001\"=/v1/{endpoint=projects/*/locations/*/" + + "endpoints/*}:countTokens:\001*ZL\"G/v1/{endp" + + "oint=projects/*/locations/*/publishers/*" + + "/models/*}:countTokens:\001*Z+\"&/v1/{endpoi" + + "nt=endpoints/*}:countTokens:\001*Z5\"0/v1/{e" + + "ndpoint=publishers/*/models/*}:countToke" + + "ns:\001*\022\213\003\n\rComputeTokens\022..google.cloud.v" + + "ertexai.v1.ComputeTokensRequest\032/.google" + + ".cloud.vertexai.v1.ComputeTokensResponse" + + "\"\230\002\332A\022endpoint,instances\202\323\344\223\002\374\001\"?/v1/{en" + + "dpoint=projects/*/locations/*/endpoints/" + + "*}:computeTokens:\001*ZN\"I/v1/{endpoint=pro" + + "jects/*/locations/*/publishers/*/models/" + + "*}:computeTokens:\001*Z-\"(/v1/{endpoint=end" + + "points/*}:computeTokens:\001*Z7\"2/v1/{endpo" + + "int=publishers/*/models/*}:computeTokens" + + ":\001*\032M\312A\031aiplatform.googleapis.com\322A.http" + + "s://www.googleapis.com/auth/cloud-platfo" + + "rmB\323\001\n\035com.google.cloud.vertexai.apiB\026Ll" + + "mUtilityServiceProtoP\001Z>cloud.google.com" + + "/go/aiplatform/apiv1/aiplatformpb;aiplat" + + "formpb\252\002\032Google.Cloud.AIPlatform.V1\312\002\032Go" + + "ogle\\Cloud\\AIPlatform\\V1\352\002\035Google::Cloud" + + "::AIPlatform::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -95,6 +103,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ClientProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.vertexai.api.ContentProto.getDescriptor(), com.google.cloud.vertexai.api.PredictionServiceProto.getDescriptor(), com.google.protobuf.StructProto.getDescriptor(), }); @@ -104,7 +113,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_vertexai_v1_ComputeTokensRequest_descriptor, new java.lang.String[] { - "Endpoint", "Instances", + "Endpoint", "Instances", "Model", "Contents", }); internal_static_google_cloud_vertexai_v1_TokensInfo_descriptor = getDescriptor().getMessageTypes().get(1); @@ -112,7 +121,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_vertexai_v1_TokensInfo_descriptor, new java.lang.String[] { - "Tokens", "TokenIds", + "Tokens", "TokenIds", "Role", }); internal_static_google_cloud_vertexai_v1_ComputeTokensResponse_descriptor = getDescriptor().getMessageTypes().get(2); @@ -136,6 +145,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ClientProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.vertexai.api.ContentProto.getDescriptor(); com.google.cloud.vertexai.api.PredictionServiceProto.getDescriptor(); com.google.protobuf.StructProto.getDescriptor(); } diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/MachineResourcesProto.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/MachineResourcesProto.java index c3376db9b0dc..10de1a1e6ff2 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/MachineResourcesProto.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/MachineResourcesProto.java @@ -80,39 +80,43 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n0google/cloud/vertexai/v1/machine_resou" + "rces.proto\022\030google.cloud.vertexai.v1\032\037go" + "ogle/api/field_behavior.proto\032/google/cl" - + "oud/vertexai/v1/accelerator_type.proto\"\250" - + "\001\n\013MachineSpec\022\031\n\014machine_type\030\001 \001(\tB\003\340A" - + "\005\022H\n\020accelerator_type\030\002 \001(\0162).google.clo" - + "ud.vertexai.v1.AcceleratorTypeB\003\340A\005\022\031\n\021a" - + "ccelerator_count\030\003 \001(\005\022\031\n\014tpu_topology\030\004" - + " \001(\tB\003\340A\005\"\364\001\n\022DedicatedResources\022C\n\014mach" - + "ine_spec\030\001 \001(\0132%.google.cloud.vertexai.v" - + "1.MachineSpecB\006\340A\002\340A\005\022!\n\021min_replica_cou" - + "nt\030\002 \001(\005B\006\340A\002\340A\005\022\036\n\021max_replica_count\030\003 " - + "\001(\005B\003\340A\005\022V\n\030autoscaling_metric_specs\030\004 \003" - + "(\0132/.google.cloud.vertexai.v1.Autoscalin" - + "gMetricSpecB\003\340A\005\"T\n\022AutomaticResources\022\036" - + "\n\021min_replica_count\030\001 \001(\005B\003\340A\005\022\036\n\021max_re" - + "plica_count\030\002 \001(\005B\003\340A\005\"\243\001\n\027BatchDedicate" + + "oud/vertexai/v1/accelerator_type.proto\0323" + + "google/cloud/vertexai/v1/reservation_aff" + + "inity.proto\"\375\001\n\013MachineSpec\022\031\n\014machine_t" + + "ype\030\001 \001(\tB\003\340A\005\022H\n\020accelerator_type\030\002 \001(\016" + + "2).google.cloud.vertexai.v1.AcceleratorT" + + "ypeB\003\340A\005\022\031\n\021accelerator_count\030\003 \001(\005\022\031\n\014t" + + "pu_topology\030\004 \001(\tB\003\340A\005\022S\n\024reservation_af" + + "finity\030\005 \001(\0132-.google.cloud.vertexai.v1." + + "ReservationAffinityB\006\340A\005\340A\001\"\207\002\n\022Dedicate" + "dResources\022C\n\014machine_spec\030\001 \001(\0132%.googl" + "e.cloud.vertexai.v1.MachineSpecB\006\340A\002\340A\005\022" - + "#\n\026starting_replica_count\030\002 \001(\005B\003\340A\005\022\036\n\021" - + "max_replica_count\030\003 \001(\005B\003\340A\005\"/\n\021Resource" - + "sConsumed\022\032\n\rreplica_hours\030\001 \001(\001B\003\340A\003\"=\n" - + "\010DiskSpec\022\026\n\016boot_disk_type\030\001 \001(\t\022\031\n\021boo" - + "t_disk_size_gb\030\002 \001(\005\"=\n\022PersistentDiskSp" - + "ec\022\021\n\tdisk_type\030\001 \001(\t\022\024\n\014disk_size_gb\030\002 " - + "\001(\003\"L\n\010NfsMount\022\023\n\006server\030\001 \001(\tB\003\340A\002\022\021\n\004" - + "path\030\002 \001(\tB\003\340A\002\022\030\n\013mount_point\030\003 \001(\tB\003\340A" - + "\002\"A\n\025AutoscalingMetricSpec\022\030\n\013metric_nam" - + "e\030\001 \001(\tB\003\340A\002\022\016\n\006target\030\002 \001(\005\".\n\020Shielded" - + "VmConfig\022\032\n\022enable_secure_boot\030\001 \001(\010B\322\001\n" - + "\035com.google.cloud.vertexai.apiB\025MachineR" - + "esourcesProtoP\001Z>cloud.google.com/go/aip" - + "latform/apiv1/aiplatformpb;aiplatformpb\252" - + "\002\032Google.Cloud.AIPlatform.V1\312\002\032Google\\Cl" - + "oud\\AIPlatform\\V1\352\002\035Google::Cloud::AIPla" - + "tform::V1b\006proto3" + + "!\n\021min_replica_count\030\002 \001(\005B\006\340A\002\340A\005\022\036\n\021ma" + + "x_replica_count\030\003 \001(\005B\003\340A\005\022V\n\030autoscalin" + + "g_metric_specs\030\004 \003(\0132/.google.cloud.vert" + + "exai.v1.AutoscalingMetricSpecB\003\340A\005\022\021\n\004sp" + + "ot\030\005 \001(\010B\003\340A\001\"T\n\022AutomaticResources\022\036\n\021m" + + "in_replica_count\030\001 \001(\005B\003\340A\005\022\036\n\021max_repli" + + "ca_count\030\002 \001(\005B\003\340A\005\"\243\001\n\027BatchDedicatedRe" + + "sources\022C\n\014machine_spec\030\001 \001(\0132%.google.c" + + "loud.vertexai.v1.MachineSpecB\006\340A\002\340A\005\022#\n\026" + + "starting_replica_count\030\002 \001(\005B\003\340A\005\022\036\n\021max" + + "_replica_count\030\003 \001(\005B\003\340A\005\"/\n\021ResourcesCo" + + "nsumed\022\032\n\rreplica_hours\030\001 \001(\001B\003\340A\003\"=\n\010Di" + + "skSpec\022\026\n\016boot_disk_type\030\001 \001(\t\022\031\n\021boot_d" + + "isk_size_gb\030\002 \001(\005\"=\n\022PersistentDiskSpec\022" + + "\021\n\tdisk_type\030\001 \001(\t\022\024\n\014disk_size_gb\030\002 \001(\003" + + "\"L\n\010NfsMount\022\023\n\006server\030\001 \001(\tB\003\340A\002\022\021\n\004pat" + + "h\030\002 \001(\tB\003\340A\002\022\030\n\013mount_point\030\003 \001(\tB\003\340A\002\"A" + + "\n\025AutoscalingMetricSpec\022\030\n\013metric_name\030\001" + + " \001(\tB\003\340A\002\022\016\n\006target\030\002 \001(\005\".\n\020ShieldedVmC" + + "onfig\022\032\n\022enable_secure_boot\030\001 \001(\010B\322\001\n\035co" + + "m.google.cloud.vertexai.apiB\025MachineReso" + + "urcesProtoP\001Z>cloud.google.com/go/aiplat" + + "form/apiv1/aiplatformpb;aiplatformpb\252\002\032G" + + "oogle.Cloud.AIPlatform.V1\312\002\032Google\\Cloud" + + "\\AIPlatform\\V1\352\002\035Google::Cloud::AIPlatfo" + + "rm::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -120,6 +124,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.FieldBehaviorProto.getDescriptor(), com.google.cloud.vertexai.api.AcceleratorTypeProto.getDescriptor(), + com.google.cloud.vertexai.api.ReservationAffinityProto.getDescriptor(), }); internal_static_google_cloud_vertexai_v1_MachineSpec_descriptor = getDescriptor().getMessageTypes().get(0); @@ -127,7 +132,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_vertexai_v1_MachineSpec_descriptor, new java.lang.String[] { - "MachineType", "AcceleratorType", "AcceleratorCount", "TpuTopology", + "MachineType", + "AcceleratorType", + "AcceleratorCount", + "TpuTopology", + "ReservationAffinity", }); internal_static_google_cloud_vertexai_v1_DedicatedResources_descriptor = getDescriptor().getMessageTypes().get(1); @@ -135,7 +144,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_vertexai_v1_DedicatedResources_descriptor, new java.lang.String[] { - "MachineSpec", "MinReplicaCount", "MaxReplicaCount", "AutoscalingMetricSpecs", + "MachineSpec", "MinReplicaCount", "MaxReplicaCount", "AutoscalingMetricSpecs", "Spot", }); internal_static_google_cloud_vertexai_v1_AutomaticResources_descriptor = getDescriptor().getMessageTypes().get(2); @@ -208,6 +217,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.cloud.vertexai.api.AcceleratorTypeProto.getDescriptor(); + com.google.cloud.vertexai.api.ReservationAffinityProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/MachineSpec.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/MachineSpec.java index 7a3b8d8182e8..8abcd5d1b70c 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/MachineSpec.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/MachineSpec.java @@ -65,6 +65,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.vertexai.api.MachineSpec.Builder.class); } + private int bitField0_; public static final int MACHINE_TYPE_FIELD_NUMBER = 1; @SuppressWarnings("serial") @@ -254,6 +255,66 @@ public com.google.protobuf.ByteString getTpuTopologyBytes() { } } + public static final int RESERVATION_AFFINITY_FIELD_NUMBER = 5; + private com.google.cloud.vertexai.api.ReservationAffinity reservationAffinity_; + /** + * + * + *
+   * Optional. Immutable. Configuration controlling how this resource pool
+   * consumes reservation.
+   * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reservationAffinity field is set. + */ + @java.lang.Override + public boolean hasReservationAffinity() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Immutable. Configuration controlling how this resource pool
+   * consumes reservation.
+   * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reservationAffinity. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ReservationAffinity getReservationAffinity() { + return reservationAffinity_ == null + ? com.google.cloud.vertexai.api.ReservationAffinity.getDefaultInstance() + : reservationAffinity_; + } + /** + * + * + *
+   * Optional. Immutable. Configuration controlling how this resource pool
+   * consumes reservation.
+   * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ReservationAffinityOrBuilder + getReservationAffinityOrBuilder() { + return reservationAffinity_ == null + ? com.google.cloud.vertexai.api.ReservationAffinity.getDefaultInstance() + : reservationAffinity_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -281,6 +342,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tpuTopology_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, tpuTopology_); } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getReservationAffinity()); + } getUnknownFields().writeTo(output); } @@ -303,6 +367,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tpuTopology_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, tpuTopology_); } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getReservationAffinity()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -323,6 +390,10 @@ public boolean equals(final java.lang.Object obj) { if (acceleratorType_ != other.acceleratorType_) return false; if (getAcceleratorCount() != other.getAcceleratorCount()) return false; if (!getTpuTopology().equals(other.getTpuTopology())) return false; + if (hasReservationAffinity() != other.hasReservationAffinity()) return false; + if (hasReservationAffinity()) { + if (!getReservationAffinity().equals(other.getReservationAffinity())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -342,6 +413,10 @@ public int hashCode() { hash = (53 * hash) + getAcceleratorCount(); hash = (37 * hash) + TPU_TOPOLOGY_FIELD_NUMBER; hash = (53 * hash) + getTpuTopology().hashCode(); + if (hasReservationAffinity()) { + hash = (37 * hash) + RESERVATION_AFFINITY_FIELD_NUMBER; + hash = (53 * hash) + getReservationAffinity().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -471,10 +546,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.vertexai.api.MachineSpec.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getReservationAffinityFieldBuilder(); + } } @java.lang.Override @@ -485,6 +569,11 @@ public Builder clear() { acceleratorType_ = 0; acceleratorCount_ = 0; tpuTopology_ = ""; + reservationAffinity_ = null; + if (reservationAffinityBuilder_ != null) { + reservationAffinityBuilder_.dispose(); + reservationAffinityBuilder_ = null; + } return this; } @@ -533,6 +622,15 @@ private void buildPartial0(com.google.cloud.vertexai.api.MachineSpec result) { if (((from_bitField0_ & 0x00000008) != 0)) { result.tpuTopology_ = tpuTopology_; } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.reservationAffinity_ = + reservationAffinityBuilder_ == null + ? reservationAffinity_ + : reservationAffinityBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -596,6 +694,9 @@ public Builder mergeFrom(com.google.cloud.vertexai.api.MachineSpec other) { bitField0_ |= 0x00000008; onChanged(); } + if (other.hasReservationAffinity()) { + mergeReservationAffinity(other.getReservationAffinity()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -646,6 +747,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000008; break; } // case 34 + case 42: + { + input.readMessage( + getReservationAffinityFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1105,6 +1213,223 @@ public Builder setTpuTopologyBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.cloud.vertexai.api.ReservationAffinity reservationAffinity_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ReservationAffinity, + com.google.cloud.vertexai.api.ReservationAffinity.Builder, + com.google.cloud.vertexai.api.ReservationAffinityOrBuilder> + reservationAffinityBuilder_; + /** + * + * + *
+     * Optional. Immutable. Configuration controlling how this resource pool
+     * consumes reservation.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reservationAffinity field is set. + */ + public boolean hasReservationAffinity() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Optional. Immutable. Configuration controlling how this resource pool
+     * consumes reservation.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reservationAffinity. + */ + public com.google.cloud.vertexai.api.ReservationAffinity getReservationAffinity() { + if (reservationAffinityBuilder_ == null) { + return reservationAffinity_ == null + ? com.google.cloud.vertexai.api.ReservationAffinity.getDefaultInstance() + : reservationAffinity_; + } else { + return reservationAffinityBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Immutable. Configuration controlling how this resource pool
+     * consumes reservation.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReservationAffinity(com.google.cloud.vertexai.api.ReservationAffinity value) { + if (reservationAffinityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reservationAffinity_ = value; + } else { + reservationAffinityBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Configuration controlling how this resource pool
+     * consumes reservation.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setReservationAffinity( + com.google.cloud.vertexai.api.ReservationAffinity.Builder builderForValue) { + if (reservationAffinityBuilder_ == null) { + reservationAffinity_ = builderForValue.build(); + } else { + reservationAffinityBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Configuration controlling how this resource pool
+     * consumes reservation.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeReservationAffinity( + com.google.cloud.vertexai.api.ReservationAffinity value) { + if (reservationAffinityBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && reservationAffinity_ != null + && reservationAffinity_ + != com.google.cloud.vertexai.api.ReservationAffinity.getDefaultInstance()) { + getReservationAffinityBuilder().mergeFrom(value); + } else { + reservationAffinity_ = value; + } + } else { + reservationAffinityBuilder_.mergeFrom(value); + } + if (reservationAffinity_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Immutable. Configuration controlling how this resource pool
+     * consumes reservation.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearReservationAffinity() { + bitField0_ = (bitField0_ & ~0x00000010); + reservationAffinity_ = null; + if (reservationAffinityBuilder_ != null) { + reservationAffinityBuilder_.dispose(); + reservationAffinityBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Configuration controlling how this resource pool
+     * consumes reservation.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.ReservationAffinity.Builder + getReservationAffinityBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getReservationAffinityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Immutable. Configuration controlling how this resource pool
+     * consumes reservation.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.vertexai.api.ReservationAffinityOrBuilder + getReservationAffinityOrBuilder() { + if (reservationAffinityBuilder_ != null) { + return reservationAffinityBuilder_.getMessageOrBuilder(); + } else { + return reservationAffinity_ == null + ? com.google.cloud.vertexai.api.ReservationAffinity.getDefaultInstance() + : reservationAffinity_; + } + } + /** + * + * + *
+     * Optional. Immutable. Configuration controlling how this resource pool
+     * consumes reservation.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ReservationAffinity, + com.google.cloud.vertexai.api.ReservationAffinity.Builder, + com.google.cloud.vertexai.api.ReservationAffinityOrBuilder> + getReservationAffinityFieldBuilder() { + if (reservationAffinityBuilder_ == null) { + reservationAffinityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.vertexai.api.ReservationAffinity, + com.google.cloud.vertexai.api.ReservationAffinity.Builder, + com.google.cloud.vertexai.api.ReservationAffinityOrBuilder>( + getReservationAffinity(), getParentForChildren(), isClean()); + reservationAffinity_ = null; + } + return reservationAffinityBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/MachineSpecOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/MachineSpecOrBuilder.java index 61d8e43278f9..6e78fbb13be8 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/MachineSpecOrBuilder.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/MachineSpecOrBuilder.java @@ -145,4 +145,48 @@ public interface MachineSpecOrBuilder * @return The bytes for tpuTopology. */ com.google.protobuf.ByteString getTpuTopologyBytes(); + + /** + * + * + *
+   * Optional. Immutable. Configuration controlling how this resource pool
+   * consumes reservation.
+   * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the reservationAffinity field is set. + */ + boolean hasReservationAffinity(); + /** + * + * + *
+   * Optional. Immutable. Configuration controlling how this resource pool
+   * consumes reservation.
+   * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The reservationAffinity. + */ + com.google.cloud.vertexai.api.ReservationAffinity getReservationAffinity(); + /** + * + * + *
+   * Optional. Immutable. Configuration controlling how this resource pool
+   * consumes reservation.
+   * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity reservation_affinity = 5 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.vertexai.api.ReservationAffinityOrBuilder getReservationAffinityOrBuilder(); } diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/PredictionServiceProto.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/PredictionServiceProto.java index dd04ea81c93d..dc4f3304eb5d 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/PredictionServiceProto.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/PredictionServiceProto.java @@ -209,139 +209,135 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ainResponse\022;\n\014explanations\030\001 \003(\0132%.goog" + "le.cloud.vertexai.v1.Explanation\022\031\n\021depl" + "oyed_model_id\030\002 \001(\t\022+\n\013predictions\030\003 \003(\013" - + "2\026.google.protobuf.Value\"\320\001\n\022CountTokens" + + "2\026.google.protobuf.Value\"\344\002\n\022CountTokens" + "Request\022<\n\010endpoint\030\001 \001(\tB*\340A\002\372A$\n\"aipla" + "tform.googleapis.com/Endpoint\022\022\n\005model\030\003" - + " \001(\tB\003\340A\002\022.\n\tinstances\030\002 \003(\0132\026.google.pr" - + "otobuf.ValueB\003\340A\002\0228\n\010contents\030\004 \003(\0132!.go" - + "ogle.cloud.vertexai.v1.ContentB\003\340A\002\"N\n\023C" - + "ountTokensResponse\022\024\n\014total_tokens\030\001 \001(\005" - + "\022!\n\031total_billable_characters\030\002 \001(\005\"\315\003\n\026" - + "GenerateContentRequest\022\022\n\005model\030\005 \001(\tB\003\340" - + "A\002\0228\n\010contents\030\002 \003(\0132!.google.cloud.vert" - + "exai.v1.ContentB\003\340A\002\022G\n\022system_instructi" - + "on\030\010 \001(\0132!.google.cloud.vertexai.v1.Cont" - + "entB\003\340A\001H\000\210\001\001\0222\n\005tools\030\006 \003(\0132\036.google.cl" - + "oud.vertexai.v1.ToolB\003\340A\001\022>\n\013tool_config" - + "\030\007 \001(\0132$.google.cloud.vertexai.v1.ToolCo" - + "nfigB\003\340A\001\022E\n\017safety_settings\030\003 \003(\0132\'.goo" - + "gle.cloud.vertexai.v1.SafetySettingB\003\340A\001" - + "\022J\n\021generation_config\030\004 \001(\0132*.google.clo" - + "ud.vertexai.v1.GenerationConfigB\003\340A\001B\025\n\023" - + "_system_instruction\"\315\005\n\027GenerateContentR" - + "esponse\022<\n\ncandidates\030\002 \003(\0132#.google.clo" - + "ud.vertexai.v1.CandidateB\003\340A\003\022^\n\017prompt_" - + "feedback\030\003 \001(\0132@.google.cloud.vertexai.v" - + "1.GenerateContentResponse.PromptFeedback" - + "B\003\340A\003\022W\n\016usage_metadata\030\004 \001(\0132?.google.c" - + "loud.vertexai.v1.GenerateContentResponse" - + ".UsageMetadata\032\322\002\n\016PromptFeedback\022i\n\014blo" - + "ck_reason\030\001 \001(\0162N.google.cloud.vertexai." - + "v1.GenerateContentResponse.PromptFeedbac" - + "k.BlockedReasonB\003\340A\003\022C\n\016safety_ratings\030\002" - + " \003(\0132&.google.cloud.vertexai.v1.SafetyRa" - + "tingB\003\340A\003\022!\n\024block_reason_message\030\003 \001(\tB" - + "\003\340A\003\"m\n\rBlockedReason\022\036\n\032BLOCKED_REASON_" - + "UNSPECIFIED\020\000\022\n\n\006SAFETY\020\001\022\t\n\005OTHER\020\002\022\r\n\t" - + "BLOCKLIST\020\003\022\026\n\022PROHIBITED_CONTENT\020\004\032f\n\rU" - + "sageMetadata\022\032\n\022prompt_token_count\030\001 \001(\005" - + "\022\036\n\026candidates_token_count\030\002 \001(\005\022\031\n\021tota" - + "l_token_count\030\003 \001(\0052\346\033\n\021PredictionServic" - + "e\022\220\002\n\007Predict\022(.google.cloud.vertexai.v1" - + ".PredictRequest\032).google.cloud.vertexai." - + "v1.PredictResponse\"\257\001\332A\035endpoint,instanc" - + "es,parameters\202\323\344\223\002\210\001\"9/v1/{endpoint=proj" - + "ects/*/locations/*/endpoints/*}:predict:" - + "\001*ZH\"C/v1/{endpoint=projects/*/locations" - + "/*/publishers/*/models/*}:predict:\001*\022\374\001\n" - + "\nRawPredict\022+.google.cloud.vertexai.v1.R" - + "awPredictRequest\032\024.google.api.HttpBody\"\252" - + "\001\332A\022endpoint,http_body\202\323\344\223\002\216\001\"\n\013tool_config\030\007 \001(\0132$.goo" + + "gle.cloud.vertexai.v1.ToolConfigB\003\340A\001\022E\n" + + "\017safety_settings\030\003 \003(\0132\'.google.cloud.ve" + + "rtexai.v1.SafetySettingB\003\340A\001\022J\n\021generati" + + "on_config\030\004 \001(\0132*.google.cloud.vertexai." + + "v1.GenerationConfigB\003\340A\001B\025\n\023_system_inst" + + "ruction\"\315\005\n\027GenerateContentResponse\022<\n\nc" + + "andidates\030\002 \003(\0132#.google.cloud.vertexai." + + "v1.CandidateB\003\340A\003\022^\n\017prompt_feedback\030\003 \001" + + "(\0132@.google.cloud.vertexai.v1.GenerateCo" + + "ntentResponse.PromptFeedbackB\003\340A\003\022W\n\016usa" + + "ge_metadata\030\004 \001(\0132?.google.cloud.vertexa" + + "i.v1.GenerateContentResponse.UsageMetada" + + "ta\032\322\002\n\016PromptFeedback\022i\n\014block_reason\030\001 " + + "\001(\0162N.google.cloud.vertexai.v1.GenerateC" + + "ontentResponse.PromptFeedback.BlockedRea" + + "sonB\003\340A\003\022C\n\016safety_ratings\030\002 \003(\0132&.googl" + + "e.cloud.vertexai.v1.SafetyRatingB\003\340A\003\022!\n" + + "\024block_reason_message\030\003 \001(\tB\003\340A\003\"m\n\rBloc" + + "kedReason\022\036\n\032BLOCKED_REASON_UNSPECIFIED\020" + + "\000\022\n\n\006SAFETY\020\001\022\t\n\005OTHER\020\002\022\r\n\tBLOCKLIST\020\003\022" + + "\026\n\022PROHIBITED_CONTENT\020\004\032f\n\rUsageMetadata" + + "\022\032\n\022prompt_token_count\030\001 \001(\005\022\036\n\026candidat" + + "es_token_count\030\002 \001(\005\022\031\n\021total_token_coun" + + "t\030\003 \001(\0052\301\031\n\021PredictionService\022\220\002\n\007Predic" + + "t\022(.google.cloud.vertexai.v1.PredictRequ" + + "est\032).google.cloud.vertexai.v1.PredictRe" + + "sponse\"\257\001\332A\035endpoint,instances,parameter" + + "s\202\323\344\223\002\210\001\"9/v1/{endpoint=projects/*/locat" + + "ions/*/endpoints/*}:predict:\001*ZH\"C/v1/{e" + "ndpoint=projects/*/locations/*/publisher" - + "s/*/models/*}:streamDirectPredict:\001*(\0010\001" - + "\022\277\002\n\026StreamDirectRawPredict\0227.google.clo" - + "ud.vertexai.v1.StreamDirectRawPredictReq" - + "uest\0328.google.cloud.vertexai.v1.StreamDi" - + "rectRawPredictResponse\"\255\001\202\323\344\223\002\246\001\"H/v1/{e" - + "ndpoint=projects/*/locations/*/endpoints" - + "/*}:streamDirectRawPredict:\001*ZW\"R/v1/{en" - + "dpoint=projects/*/locations/*/publishers" - + "/*/models/*}:streamDirectRawPredict:\001*(\001" - + "0\001\022\177\n\020StreamingPredict\0221.google.cloud.ve" - + "rtexai.v1.StreamingPredictRequest\0322.goog" - + "le.cloud.vertexai.v1.StreamingPredictRes" - + "ponse\"\000(\0010\001\022\261\002\n\026ServerStreamingPredict\0221" - + ".google.cloud.vertexai.v1.StreamingPredi" - + "ctRequest\0322.google.cloud.vertexai.v1.Str" - + "eamingPredictResponse\"\255\001\202\323\344\223\002\246\001\"H/v1/{en" - + "dpoint=projects/*/locations/*/endpoints/" - + "*}:serverStreamingPredict:\001*ZW\"R/v1/{end" - + "point=projects/*/locations/*/publishers/" - + "*/models/*}:serverStreamingPredict:\001*0\001\022" - + "\210\001\n\023StreamingRawPredict\0224.google.cloud.v" - + "ertexai.v1.StreamingRawPredictRequest\0325." - + "google.cloud.vertexai.v1.StreamingRawPre" - + "dictResponse\"\000(\0010\001\022\326\001\n\007Explain\022(.google." - + "cloud.vertexai.v1.ExplainRequest\032).googl" - + "e.cloud.vertexai.v1.ExplainResponse\"v\332A/" - + "endpoint,instances,parameters,deployed_m" - + "odel_id\202\323\344\223\002>\"9/v1/{endpoint=projects/*/" - + "locations/*/endpoints/*}:explain:\001*\022\243\002\n\017" - + "GenerateContent\0220.google.cloud.vertexai." - + "v1.GenerateContentRequest\0321.google.cloud" - + ".vertexai.v1.GenerateContentResponse\"\252\001\332" - + "A\016model,contents\202\323\344\223\002\222\001\">/v1/{model=proj" - + "ects/*/locations/*/endpoints/*}:generate" - + "Content:\001*ZM\"H/v1/{model=projects/*/loca" - + "tions/*/publishers/*/models/*}:generateC" - + "ontent:\001*\022\267\002\n\025StreamGenerateContent\0220.go" - + "ogle.cloud.vertexai.v1.GenerateContentRe" - + "quest\0321.google.cloud.vertexai.v1.Generat" - + "eContentResponse\"\266\001\332A\016model,contents\202\323\344\223" - + "\002\236\001\"D/v1/{model=projects/*/locations/*/e" - + "ndpoints/*}:streamGenerateContent:\001*ZS\"N" - + "/v1/{model=projects/*/locations/*/publis" - + "hers/*/models/*}:streamGenerateContent:\001" - + "*0\001\032\206\001\312A\031aiplatform.googleapis.com\322Aghtt" - + "ps://www.googleapis.com/auth/cloud-platf" - + "orm,https://www.googleapis.com/auth/clou" - + "d-platform.read-onlyB\323\001\n\035com.google.clou" - + "d.vertexai.apiB\026PredictionServiceProtoP\001" - + "Z>cloud.google.com/go/aiplatform/apiv1/a" - + "iplatformpb;aiplatformpb\252\002\032Google.Cloud." - + "AIPlatform.V1\312\002\032Google\\Cloud\\AIPlatform\\" - + "V1\352\002\035Google::Cloud::AIPlatform::V1b\006prot" - + "o3" + + "s/*/models/*}:predict:\001*\022\374\001\n\nRawPredict\022" + + "+.google.cloud.vertexai.v1.RawPredictReq" + + "uest\032\024.google.api.HttpBody\"\252\001\332A\022endpoint" + + ",http_body\202\323\344\223\002\216\001\"\"9/v1/{endpoint=projects/*/l" + + "ocations/*/endpoints/*}:explain:\001*\022\211\003\n\017G" + + "enerateContent\0220.google.cloud.vertexai.v" + + "1.GenerateContentRequest\0321.google.cloud." + + "vertexai.v1.GenerateContentResponse\"\220\002\332A" + + "\016model,contents\202\323\344\223\002\370\001\">/v1/{model=proje" + + "cts/*/locations/*/endpoints/*}:generateC" + + "ontent:\001*ZM\"H/v1/{model=projects/*/locat" + + "ions/*/publishers/*/models/*}:generateCo" + + "ntent:\001*Z,\"\'/v1/{model=endpoints/*}:gene" + + "rateContent:\001*Z6\"1/v1/{model=publishers/" + + "*/models/*}:generateContent:\001*\022\251\003\n\025Strea" + + "mGenerateContent\0220.google.cloud.vertexai" + + ".v1.GenerateContentRequest\0321.google.clou" + + "d.vertexai.v1.GenerateContentResponse\"\250\002" + + "\332A\016model,contents\202\323\344\223\002\220\002\"D/v1/{model=pro" + + "jects/*/locations/*/endpoints/*}:streamG" + + "enerateContent:\001*ZS\"N/v1/{model=projects" + + "/*/locations/*/publishers/*/models/*}:st" + + "reamGenerateContent:\001*Z2\"-/v1/{model=end" + + "points/*}:streamGenerateContent:\001*Z<\"7/v" + + "1/{model=publishers/*/models/*}:streamGe" + + "nerateContent:\001*0\001\032\206\001\312A\031aiplatform.googl" + + "eapis.com\322Aghttps://www.googleapis.com/a" + + "uth/cloud-platform,https://www.googleapi" + + "s.com/auth/cloud-platform.read-onlyB\323\001\n\035" + + "com.google.cloud.vertexai.apiB\026Predictio" + + "nServiceProtoP\001Z>cloud.google.com/go/aip" + + "latform/apiv1/aiplatformpb;aiplatformpb\252" + + "\002\032Google.Cloud.AIPlatform.V1\312\002\032Google\\Cl" + + "oud\\AIPlatform\\V1\352\002\035Google::Cloud::AIPla" + + "tform::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -513,7 +509,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_vertexai_v1_CountTokensRequest_descriptor, new java.lang.String[] { - "Endpoint", "Model", "Instances", "Contents", + "Endpoint", "Model", "Instances", "Contents", "SystemInstruction", "Tools", }); internal_static_google_cloud_vertexai_v1_CountTokensResponse_descriptor = getDescriptor().getMessageTypes().get(19); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/PrivateServiceConnectConfig.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/PrivateServiceConnectConfig.java index c0b1b5e63510..779695a5783e 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/PrivateServiceConnectConfig.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/PrivateServiceConnectConfig.java @@ -40,6 +40,7 @@ private PrivateServiceConnectConfig(com.google.protobuf.GeneratedMessageV3.Build private PrivateServiceConnectConfig() { projectAllowlist_ = com.google.protobuf.LazyStringArrayList.emptyList(); + serviceAttachment_ = ""; } @java.lang.Override @@ -149,6 +150,61 @@ public com.google.protobuf.ByteString getProjectAllowlistBytes(int index) { return projectAllowlist_.getByteString(index); } + public static final int SERVICE_ATTACHMENT_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAttachment_ = ""; + /** + * + * + *
+   * Output only. The name of the generated service attachment resource.
+   * This is only populated if the endpoint is deployed with
+   * PrivateServiceConnect.
+   * 
+ * + * string service_attachment = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAttachment. + */ + @java.lang.Override + public java.lang.String getServiceAttachment() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachment_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of the generated service attachment resource.
+   * This is only populated if the endpoint is deployed with
+   * PrivateServiceConnect.
+   * 
+ * + * string service_attachment = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAttachment. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAttachmentBytes() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -169,6 +225,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < projectAllowlist_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, projectAllowlist_.getRaw(i)); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachment_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, serviceAttachment_); + } getUnknownFields().writeTo(output); } @@ -190,6 +249,9 @@ public int getSerializedSize() { size += dataSize; size += 1 * getProjectAllowlistList().size(); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachment_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, serviceAttachment_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -208,6 +270,7 @@ public boolean equals(final java.lang.Object obj) { if (getEnablePrivateServiceConnect() != other.getEnablePrivateServiceConnect()) return false; if (!getProjectAllowlistList().equals(other.getProjectAllowlistList())) return false; + if (!getServiceAttachment().equals(other.getServiceAttachment())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -225,6 +288,8 @@ public int hashCode() { hash = (37 * hash) + PROJECT_ALLOWLIST_FIELD_NUMBER; hash = (53 * hash) + getProjectAllowlistList().hashCode(); } + hash = (37 * hash) + SERVICE_ATTACHMENT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAttachment().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -367,6 +432,7 @@ public Builder clear() { bitField0_ = 0; enablePrivateServiceConnect_ = false; projectAllowlist_ = com.google.protobuf.LazyStringArrayList.emptyList(); + serviceAttachment_ = ""; return this; } @@ -410,6 +476,9 @@ private void buildPartial0(com.google.cloud.vertexai.api.PrivateServiceConnectCo projectAllowlist_.makeImmutable(); result.projectAllowlist_ = projectAllowlist_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.serviceAttachment_ = serviceAttachment_; + } } @java.lang.Override @@ -471,6 +540,11 @@ public Builder mergeFrom(com.google.cloud.vertexai.api.PrivateServiceConnectConf } onChanged(); } + if (!other.getServiceAttachment().isEmpty()) { + serviceAttachment_ = other.serviceAttachment_; + bitField0_ |= 0x00000004; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -510,6 +584,12 @@ public Builder mergeFrom( projectAllowlist_.add(s); break; } // case 18 + case 42: + { + serviceAttachment_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 42 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -768,6 +848,122 @@ public Builder addProjectAllowlistBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object serviceAttachment_ = ""; + /** + * + * + *
+     * Output only. The name of the generated service attachment resource.
+     * This is only populated if the endpoint is deployed with
+     * PrivateServiceConnect.
+     * 
+ * + * string service_attachment = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAttachment. + */ + public java.lang.String getServiceAttachment() { + java.lang.Object ref = serviceAttachment_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachment_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of the generated service attachment resource.
+     * This is only populated if the endpoint is deployed with
+     * PrivateServiceConnect.
+     * 
+ * + * string service_attachment = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAttachment. + */ + public com.google.protobuf.ByteString getServiceAttachmentBytes() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of the generated service attachment resource.
+     * This is only populated if the endpoint is deployed with
+     * PrivateServiceConnect.
+     * 
+ * + * string service_attachment = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The serviceAttachment to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachment(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceAttachment_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the generated service attachment resource.
+     * This is only populated if the endpoint is deployed with
+     * PrivateServiceConnect.
+     * 
+ * + * string service_attachment = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearServiceAttachment() { + serviceAttachment_ = getDefaultInstance().getServiceAttachment(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the generated service attachment resource.
+     * This is only populated if the endpoint is deployed with
+     * PrivateServiceConnect.
+     * 
+ * + * string service_attachment = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for serviceAttachment to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachmentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceAttachment_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/PrivateServiceConnectConfigOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/PrivateServiceConnectConfigOrBuilder.java index a8f3f84bee0c..895ae1562fbc 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/PrivateServiceConnectConfigOrBuilder.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/PrivateServiceConnectConfigOrBuilder.java @@ -91,4 +91,33 @@ public interface PrivateServiceConnectConfigOrBuilder * @return The bytes of the projectAllowlist at the given index. */ com.google.protobuf.ByteString getProjectAllowlistBytes(int index); + + /** + * + * + *
+   * Output only. The name of the generated service attachment resource.
+   * This is only populated if the endpoint is deployed with
+   * PrivateServiceConnect.
+   * 
+ * + * string service_attachment = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAttachment. + */ + java.lang.String getServiceAttachment(); + /** + * + * + *
+   * Output only. The name of the generated service attachment resource.
+   * This is only populated if the endpoint is deployed with
+   * PrivateServiceConnect.
+   * 
+ * + * string service_attachment = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAttachment. + */ + com.google.protobuf.ByteString getServiceAttachmentBytes(); } diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ReservationAffinity.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ReservationAffinity.java new file mode 100644 index 000000000000..6f8ac5a757d0 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ReservationAffinity.java @@ -0,0 +1,1319 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1/reservation_affinity.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * A ReservationAffinity can be used to configure a Vertex AI resource (e.g., a
+ * DeployedModel) to draw its Compute Engine resources from a Shared
+ * Reservation, or exclusively from on-demand capacity.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.ReservationAffinity} + */ +public final class ReservationAffinity extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1.ReservationAffinity) + ReservationAffinityOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReservationAffinity.newBuilder() to construct. + private ReservationAffinity(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReservationAffinity() { + reservationAffinityType_ = 0; + key_ = ""; + values_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReservationAffinity(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ReservationAffinityProto + .internal_static_google_cloud_vertexai_v1_ReservationAffinity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ReservationAffinityProto + .internal_static_google_cloud_vertexai_v1_ReservationAffinity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ReservationAffinity.class, + com.google.cloud.vertexai.api.ReservationAffinity.Builder.class); + } + + /** + * + * + *
+   * Identifies a type of reservation affinity.
+   * 
+ * + * Protobuf enum {@code google.cloud.vertexai.v1.ReservationAffinity.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This should not be used.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Do not consume from any reserved capacity, only use on-demand.
+     * 
+ * + * NO_RESERVATION = 1; + */ + NO_RESERVATION(1), + /** + * + * + *
+     * Consume any reservation available, falling back to on-demand.
+     * 
+ * + * ANY_RESERVATION = 2; + */ + ANY_RESERVATION(2), + /** + * + * + *
+     * Consume from a specific reservation. When chosen, the reservation
+     * must be identified via the `key` and `values` fields.
+     * 
+ * + * SPECIFIC_RESERVATION = 3; + */ + SPECIFIC_RESERVATION(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This should not be used.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Do not consume from any reserved capacity, only use on-demand.
+     * 
+ * + * NO_RESERVATION = 1; + */ + public static final int NO_RESERVATION_VALUE = 1; + /** + * + * + *
+     * Consume any reservation available, falling back to on-demand.
+     * 
+ * + * ANY_RESERVATION = 2; + */ + public static final int ANY_RESERVATION_VALUE = 2; + /** + * + * + *
+     * Consume from a specific reservation. When chosen, the reservation
+     * must be identified via the `key` and `values` fields.
+     * 
+ * + * SPECIFIC_RESERVATION = 3; + */ + public static final int SPECIFIC_RESERVATION_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return NO_RESERVATION; + case 2: + return ANY_RESERVATION; + case 3: + return SPECIFIC_RESERVATION; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.vertexai.api.ReservationAffinity.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.vertexai.v1.ReservationAffinity.Type) + } + + public static final int RESERVATION_AFFINITY_TYPE_FIELD_NUMBER = 1; + private int reservationAffinityType_ = 0; + /** + * + * + *
+   * Required. Specifies the reservation affinity type.
+   * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity.Type reservation_affinity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for reservationAffinityType. + */ + @java.lang.Override + public int getReservationAffinityTypeValue() { + return reservationAffinityType_; + } + /** + * + * + *
+   * Required. Specifies the reservation affinity type.
+   * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity.Type reservation_affinity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The reservationAffinityType. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ReservationAffinity.Type getReservationAffinityType() { + com.google.cloud.vertexai.api.ReservationAffinity.Type result = + com.google.cloud.vertexai.api.ReservationAffinity.Type.forNumber(reservationAffinityType_); + return result == null + ? com.google.cloud.vertexai.api.ReservationAffinity.Type.UNRECOGNIZED + : result; + } + + public static final int KEY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + /** + * + * + *
+   * Optional. Corresponds to the label key of a reservation resource. To target
+   * a SPECIFIC_RESERVATION by name, use
+   * `compute.googleapis.com/reservation-name` as the key and specify the name
+   * of your reservation as its value.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Corresponds to the label key of a reservation resource. To target
+   * a SPECIFIC_RESERVATION by name, use
+   * `compute.googleapis.com/reservation-name` as the key and specify the name
+   * of your reservation as its value.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList values_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Optional. Corresponds to the label values of a reservation resource. This
+   * must be the full resource name of the reservation.
+   * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + return values_; + } + /** + * + * + *
+   * Optional. Corresponds to the label values of a reservation resource. This
+   * must be the full resource name of the reservation.
+   * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+   * Optional. Corresponds to the label values of a reservation resource. This
+   * must be the full resource name of the reservation.
+   * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+   * Optional. Corresponds to the label values of a reservation resource. This
+   * must be the full resource name of the reservation.
+   * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (reservationAffinityType_ + != com.google.cloud.vertexai.api.ReservationAffinity.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, reservationAffinityType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); + } + for (int i = 0; i < values_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, values_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reservationAffinityType_ + != com.google.cloud.vertexai.api.ReservationAffinity.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, reservationAffinityType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); + } + { + int dataSize = 0; + for (int i = 0; i < values_.size(); i++) { + dataSize += computeStringSizeNoTag(values_.getRaw(i)); + } + size += dataSize; + size += 1 * getValuesList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.ReservationAffinity)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.ReservationAffinity other = + (com.google.cloud.vertexai.api.ReservationAffinity) obj; + + if (reservationAffinityType_ != other.reservationAffinityType_) return false; + if (!getKey().equals(other.getKey())) return false; + if (!getValuesList().equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESERVATION_AFFINITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + reservationAffinityType_; + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.ReservationAffinity parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ReservationAffinity parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ReservationAffinity parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ReservationAffinity parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ReservationAffinity parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.ReservationAffinity parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ReservationAffinity parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ReservationAffinity parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ReservationAffinity parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ReservationAffinity parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.ReservationAffinity parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.ReservationAffinity parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.ReservationAffinity prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A ReservationAffinity can be used to configure a Vertex AI resource (e.g., a
+   * DeployedModel) to draw its Compute Engine resources from a Shared
+   * Reservation, or exclusively from on-demand capacity.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.ReservationAffinity} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1.ReservationAffinity) + com.google.cloud.vertexai.api.ReservationAffinityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ReservationAffinityProto + .internal_static_google_cloud_vertexai_v1_ReservationAffinity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ReservationAffinityProto + .internal_static_google_cloud_vertexai_v1_ReservationAffinity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.ReservationAffinity.class, + com.google.cloud.vertexai.api.ReservationAffinity.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.ReservationAffinity.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + reservationAffinityType_ = 0; + key_ = ""; + values_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ReservationAffinityProto + .internal_static_google_cloud_vertexai_v1_ReservationAffinity_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ReservationAffinity getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.ReservationAffinity.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ReservationAffinity build() { + com.google.cloud.vertexai.api.ReservationAffinity result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ReservationAffinity buildPartial() { + com.google.cloud.vertexai.api.ReservationAffinity result = + new com.google.cloud.vertexai.api.ReservationAffinity(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.ReservationAffinity result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.reservationAffinityType_ = reservationAffinityType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + values_.makeImmutable(); + result.values_ = values_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.ReservationAffinity) { + return mergeFrom((com.google.cloud.vertexai.api.ReservationAffinity) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.ReservationAffinity other) { + if (other == com.google.cloud.vertexai.api.ReservationAffinity.getDefaultInstance()) + return this; + if (other.reservationAffinityType_ != 0) { + setReservationAffinityTypeValue(other.getReservationAffinityTypeValue()); + } + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ |= 0x00000004; + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + reservationAffinityType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + key_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureValuesIsMutable(); + values_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int reservationAffinityType_ = 0; + /** + * + * + *
+     * Required. Specifies the reservation affinity type.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity.Type reservation_affinity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for reservationAffinityType. + */ + @java.lang.Override + public int getReservationAffinityTypeValue() { + return reservationAffinityType_; + } + /** + * + * + *
+     * Required. Specifies the reservation affinity type.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity.Type reservation_affinity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for reservationAffinityType to set. + * @return This builder for chaining. + */ + public Builder setReservationAffinityTypeValue(int value) { + reservationAffinityType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Specifies the reservation affinity type.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity.Type reservation_affinity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The reservationAffinityType. + */ + @java.lang.Override + public com.google.cloud.vertexai.api.ReservationAffinity.Type getReservationAffinityType() { + com.google.cloud.vertexai.api.ReservationAffinity.Type result = + com.google.cloud.vertexai.api.ReservationAffinity.Type.forNumber( + reservationAffinityType_); + return result == null + ? com.google.cloud.vertexai.api.ReservationAffinity.Type.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. Specifies the reservation affinity type.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity.Type reservation_affinity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The reservationAffinityType to set. + * @return This builder for chaining. + */ + public Builder setReservationAffinityType( + com.google.cloud.vertexai.api.ReservationAffinity.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + reservationAffinityType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Specifies the reservation affinity type.
+     * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity.Type reservation_affinity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearReservationAffinityType() { + bitField0_ = (bitField0_ & ~0x00000001); + reservationAffinityType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object key_ = ""; + /** + * + * + *
+     * Optional. Corresponds to the label key of a reservation resource. To target
+     * a SPECIFIC_RESERVATION by name, use
+     * `compute.googleapis.com/reservation-name` as the key and specify the name
+     * of your reservation as its value.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Corresponds to the label key of a reservation resource. To target
+     * a SPECIFIC_RESERVATION by name, use
+     * `compute.googleapis.com/reservation-name` as the key and specify the name
+     * of your reservation as its value.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Corresponds to the label key of a reservation resource. To target
+     * a SPECIFIC_RESERVATION by name, use
+     * `compute.googleapis.com/reservation-name` as the key and specify the name
+     * of your reservation as its value.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Corresponds to the label key of a reservation resource. To target
+     * a SPECIFIC_RESERVATION by name, use
+     * `compute.googleapis.com/reservation-name` as the key and specify the name
+     * of your reservation as its value.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Corresponds to the label key of a reservation resource. To target
+     * a SPECIFIC_RESERVATION by name, use
+     * `compute.googleapis.com/reservation-name` as the key and specify the name
+     * of your reservation as its value.
+     * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + key_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList values_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureValuesIsMutable() { + if (!values_.isModifiable()) { + values_ = new com.google.protobuf.LazyStringArrayList(values_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Optional. Corresponds to the label values of a reservation resource. This
+     * must be the full resource name of the reservation.
+     * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList getValuesList() { + values_.makeImmutable(); + return values_; + } + /** + * + * + *
+     * Optional. Corresponds to the label values of a reservation resource. This
+     * must be the full resource name of the reservation.
+     * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + * + * + *
+     * Optional. Corresponds to the label values of a reservation resource. This
+     * must be the full resource name of the reservation.
+     * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + * + * + *
+     * Optional. Corresponds to the label values of a reservation resource. This
+     * must be the full resource name of the reservation.
+     * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString getValuesBytes(int index) { + return values_.getByteString(index); + } + /** + * + * + *
+     * Optional. Corresponds to the label values of a reservation resource. This
+     * must be the full resource name of the reservation.
+     * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Corresponds to the label values of a reservation resource. This
+     * must be the full resource name of the reservation.
+     * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Corresponds to the label values of a reservation resource. This
+     * must be the full resource name of the reservation.
+     * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues(java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Corresponds to the label values of a reservation resource. This
+     * must be the full resource name of the reservation.
+     * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Corresponds to the label values of a reservation resource. This
+     * must be the full resource name of the reservation.
+     * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the values to add. + * @return This builder for chaining. + */ + public Builder addValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureValuesIsMutable(); + values_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1.ReservationAffinity) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1.ReservationAffinity) + private static final com.google.cloud.vertexai.api.ReservationAffinity DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.ReservationAffinity(); + } + + public static com.google.cloud.vertexai.api.ReservationAffinity getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReservationAffinity parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.ReservationAffinity getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ReservationAffinityOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ReservationAffinityOrBuilder.java new file mode 100644 index 000000000000..ee9206ecb279 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ReservationAffinityOrBuilder.java @@ -0,0 +1,149 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1/reservation_affinity.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.vertexai.api; + +public interface ReservationAffinityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1.ReservationAffinity) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Specifies the reservation affinity type.
+   * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity.Type reservation_affinity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for reservationAffinityType. + */ + int getReservationAffinityTypeValue(); + /** + * + * + *
+   * Required. Specifies the reservation affinity type.
+   * 
+ * + * + * .google.cloud.vertexai.v1.ReservationAffinity.Type reservation_affinity_type = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The reservationAffinityType. + */ + com.google.cloud.vertexai.api.ReservationAffinity.Type getReservationAffinityType(); + + /** + * + * + *
+   * Optional. Corresponds to the label key of a reservation resource. To target
+   * a SPECIFIC_RESERVATION by name, use
+   * `compute.googleapis.com/reservation-name` as the key and specify the name
+   * of your reservation as its value.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+   * Optional. Corresponds to the label key of a reservation resource. To target
+   * a SPECIFIC_RESERVATION by name, use
+   * `compute.googleapis.com/reservation-name` as the key and specify the name
+   * of your reservation as its value.
+   * 
+ * + * string key = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+   * Optional. Corresponds to the label values of a reservation resource. This
+   * must be the full resource name of the reservation.
+   * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the values. + */ + java.util.List getValuesList(); + /** + * + * + *
+   * Optional. Corresponds to the label values of a reservation resource. This
+   * must be the full resource name of the reservation.
+   * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The count of values. + */ + int getValuesCount(); + /** + * + * + *
+   * Optional. Corresponds to the label values of a reservation resource. This
+   * must be the full resource name of the reservation.
+   * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The values at the given index. + */ + java.lang.String getValues(int index); + /** + * + * + *
+   * Optional. Corresponds to the label values of a reservation resource. This
+   * must be the full resource name of the reservation.
+   * 
+ * + * + * repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + com.google.protobuf.ByteString getValuesBytes(int index); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ReservationAffinityProto.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ReservationAffinityProto.java new file mode 100644 index 000000000000..95193b42afbd --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ReservationAffinityProto.java @@ -0,0 +1,92 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1/reservation_affinity.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.vertexai.api; + +public final class ReservationAffinityProto { + private ReservationAffinityProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_vertexai_v1_ReservationAffinity_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_vertexai_v1_ReservationAffinity_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/vertexai/v1/reservation_a" + + "ffinity.proto\022\030google.cloud.vertexai.v1\032" + + "\037google/api/field_behavior.proto\032\031google" + + "/api/resource.proto\"\240\002\n\023ReservationAffin" + + "ity\022Z\n\031reservation_affinity_type\030\001 \001(\01622" + + ".google.cloud.vertexai.v1.ReservationAff" + + "inity.TypeB\003\340A\002\022\020\n\003key\030\002 \001(\tB\003\340A\001\022:\n\006val" + + "ues\030\003 \003(\tB*\340A\001\372A$\n\"compute.googleapis.co" + + "m/Reservation\"_\n\004Type\022\024\n\020TYPE_UNSPECIFIE" + + "D\020\000\022\022\n\016NO_RESERVATION\020\001\022\023\n\017ANY_RESERVATI" + + "ON\020\002\022\030\n\024SPECIFIC_RESERVATION\020\003B\312\002\n\035com.g" + + "oogle.cloud.vertexai.apiB\030ReservationAff" + + "inityProtoP\001Z>cloud.google.com/go/aiplat" + + "form/apiv1/aiplatformpb;aiplatformpb\252\002\032G" + + "oogle.Cloud.AIPlatform.V1\312\002\032Google\\Cloud" + + "\\AIPlatform\\V1\352\002\035Google::Cloud::AIPlatfo" + + "rm::V1\352Ar\n\"compute.googleapis.com/Reserv" + + "ation\022Lprojects/{project_id_or_number}/z" + + "ones/{zone}/reservations/{reservation_na" + + "me}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_vertexai_v1_ReservationAffinity_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_vertexai_v1_ReservationAffinity_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_vertexai_v1_ReservationAffinity_descriptor, + new java.lang.String[] { + "ReservationAffinityType", "Key", "Values", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Retrieval.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Retrieval.java index 57feedaaa5b1..ed4ba0cc7b2b 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Retrieval.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Retrieval.java @@ -164,16 +164,19 @@ public com.google.cloud.vertexai.api.VertexAISearchOrBuilder getVertexAiSearchOr * * *
-   * Optional. Disable using the result from this tool in detecting grounding
-   * attribution. This does not affect how the result is given to the model for
-   * generation.
+   * Optional. Deprecated. This option is no longer supported.
    * 
* - * bool disable_attribution = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * bool disable_attribution = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * * + * @deprecated google.cloud.vertexai.v1.Retrieval.disable_attribution is deprecated. See + * google/cloud/vertexai/v1/tool.proto;l=130 * @return The disableAttribution. */ @java.lang.Override + @java.lang.Deprecated public boolean getDisableAttribution() { return disableAttribution_; } @@ -799,16 +802,19 @@ public com.google.cloud.vertexai.api.VertexAISearchOrBuilder getVertexAiSearchOr * * *
-     * Optional. Disable using the result from this tool in detecting grounding
-     * attribution. This does not affect how the result is given to the model for
-     * generation.
+     * Optional. Deprecated. This option is no longer supported.
      * 
* - * bool disable_attribution = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * bool disable_attribution = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * * + * @deprecated google.cloud.vertexai.v1.Retrieval.disable_attribution is deprecated. See + * google/cloud/vertexai/v1/tool.proto;l=130 * @return The disableAttribution. */ @java.lang.Override + @java.lang.Deprecated public boolean getDisableAttribution() { return disableAttribution_; } @@ -816,16 +822,19 @@ public boolean getDisableAttribution() { * * *
-     * Optional. Disable using the result from this tool in detecting grounding
-     * attribution. This does not affect how the result is given to the model for
-     * generation.
+     * Optional. Deprecated. This option is no longer supported.
      * 
* - * bool disable_attribution = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * bool disable_attribution = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * * + * @deprecated google.cloud.vertexai.v1.Retrieval.disable_attribution is deprecated. See + * google/cloud/vertexai/v1/tool.proto;l=130 * @param value The disableAttribution to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setDisableAttribution(boolean value) { disableAttribution_ = value; @@ -837,15 +846,18 @@ public Builder setDisableAttribution(boolean value) { * * *
-     * Optional. Disable using the result from this tool in detecting grounding
-     * attribution. This does not affect how the result is given to the model for
-     * generation.
+     * Optional. Deprecated. This option is no longer supported.
      * 
* - * bool disable_attribution = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * bool disable_attribution = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * * + * @deprecated google.cloud.vertexai.v1.Retrieval.disable_attribution is deprecated. See + * google/cloud/vertexai/v1/tool.proto;l=130 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearDisableAttribution() { bitField0_ = (bitField0_ & ~0x00000002); disableAttribution_ = false; diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/RetrievalOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/RetrievalOrBuilder.java index 1dd28f042210..85149323f8bd 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/RetrievalOrBuilder.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/RetrievalOrBuilder.java @@ -63,15 +63,18 @@ public interface RetrievalOrBuilder * * *
-   * Optional. Disable using the result from this tool in detecting grounding
-   * attribution. This does not affect how the result is given to the model for
-   * generation.
+   * Optional. Deprecated. This option is no longer supported.
    * 
* - * bool disable_attribution = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * bool disable_attribution = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL]; + * * + * @deprecated google.cloud.vertexai.v1.Retrieval.disable_attribution is deprecated. See + * google/cloud/vertexai/v1/tool.proto;l=130 * @return The disableAttribution. */ + @java.lang.Deprecated boolean getDisableAttribution(); com.google.cloud.vertexai.api.Retrieval.SourceCase getSourceCase(); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/SafetySetting.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/SafetySetting.java index 835ec22ced1a..648d865561d3 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/SafetySetting.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/SafetySetting.java @@ -125,6 +125,16 @@ public enum HarmBlockThreshold implements com.google.protobuf.ProtocolMessageEnu * BLOCK_NONE = 4; */ BLOCK_NONE(4), + /** + * + * + *
+     * Turn off the safety filter.
+     * 
+ * + * OFF = 5; + */ + OFF(5), UNRECOGNIZED(-1), ; @@ -178,6 +188,16 @@ public enum HarmBlockThreshold implements com.google.protobuf.ProtocolMessageEnu * BLOCK_NONE = 4; */ public static final int BLOCK_NONE_VALUE = 4; + /** + * + * + *
+     * Turn off the safety filter.
+     * 
+ * + * OFF = 5; + */ + public static final int OFF_VALUE = 5; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -213,6 +233,8 @@ public static HarmBlockThreshold forNumber(int value) { return BLOCK_ONLY_HIGH; case 4: return BLOCK_NONE; + case 5: + return OFF; default: return null; } diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Segment.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Segment.java new file mode 100644 index 000000000000..84f1dfcba114 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Segment.java @@ -0,0 +1,909 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1/content.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.vertexai.api; + +/** + * + * + *
+ * Segment of the content.
+ * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.Segment} + */ +public final class Segment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1.Segment) + SegmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Segment.newBuilder() to construct. + private Segment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Segment() { + text_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Segment(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_Segment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_Segment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Segment.class, + com.google.cloud.vertexai.api.Segment.Builder.class); + } + + public static final int PART_INDEX_FIELD_NUMBER = 1; + private int partIndex_ = 0; + /** + * + * + *
+   * Output only. The index of a Part object within its parent Content object.
+   * 
+ * + * int32 part_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The partIndex. + */ + @java.lang.Override + public int getPartIndex() { + return partIndex_; + } + + public static final int START_INDEX_FIELD_NUMBER = 2; + private int startIndex_ = 0; + /** + * + * + *
+   * Output only. Start index in the given Part, measured in bytes. Offset from
+   * the start of the Part, inclusive, starting at zero.
+   * 
+ * + * int32 start_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The startIndex. + */ + @java.lang.Override + public int getStartIndex() { + return startIndex_; + } + + public static final int END_INDEX_FIELD_NUMBER = 3; + private int endIndex_ = 0; + /** + * + * + *
+   * Output only. End index in the given Part, measured in bytes. Offset from
+   * the start of the Part, exclusive, starting at zero.
+   * 
+ * + * int32 end_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The endIndex. + */ + @java.lang.Override + public int getEndIndex() { + return endIndex_; + } + + public static final int TEXT_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object text_ = ""; + /** + * + * + *
+   * Output only. The text corresponding to the segment from the response.
+   * 
+ * + * string text = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The text corresponding to the segment from the response.
+   * 
+ * + * string text = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (partIndex_ != 0) { + output.writeInt32(1, partIndex_); + } + if (startIndex_ != 0) { + output.writeInt32(2, startIndex_); + } + if (endIndex_ != 0) { + output.writeInt32(3, endIndex_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, text_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (partIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, partIndex_); + } + if (startIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, startIndex_); + } + if (endIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, endIndex_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, text_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.vertexai.api.Segment)) { + return super.equals(obj); + } + com.google.cloud.vertexai.api.Segment other = (com.google.cloud.vertexai.api.Segment) obj; + + if (getPartIndex() != other.getPartIndex()) return false; + if (getStartIndex() != other.getStartIndex()) return false; + if (getEndIndex() != other.getEndIndex()) return false; + if (!getText().equals(other.getText())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PART_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getPartIndex(); + hash = (37 * hash) + START_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getStartIndex(); + hash = (37 * hash) + END_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getEndIndex(); + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.vertexai.api.Segment parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Segment parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Segment parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Segment parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Segment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.vertexai.api.Segment parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Segment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Segment parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Segment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Segment parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.vertexai.api.Segment parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.vertexai.api.Segment parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.vertexai.api.Segment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Segment of the content.
+   * 
+ * + * Protobuf type {@code google.cloud.vertexai.v1.Segment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1.Segment) + com.google.cloud.vertexai.api.SegmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_Segment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_Segment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.vertexai.api.Segment.class, + com.google.cloud.vertexai.api.Segment.Builder.class); + } + + // Construct using com.google.cloud.vertexai.api.Segment.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + partIndex_ = 0; + startIndex_ = 0; + endIndex_ = 0; + text_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.vertexai.api.ContentProto + .internal_static_google_cloud_vertexai_v1_Segment_descriptor; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Segment getDefaultInstanceForType() { + return com.google.cloud.vertexai.api.Segment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Segment build() { + com.google.cloud.vertexai.api.Segment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Segment buildPartial() { + com.google.cloud.vertexai.api.Segment result = + new com.google.cloud.vertexai.api.Segment(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.vertexai.api.Segment result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.partIndex_ = partIndex_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startIndex_ = startIndex_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endIndex_ = endIndex_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.text_ = text_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.vertexai.api.Segment) { + return mergeFrom((com.google.cloud.vertexai.api.Segment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.vertexai.api.Segment other) { + if (other == com.google.cloud.vertexai.api.Segment.getDefaultInstance()) return this; + if (other.getPartIndex() != 0) { + setPartIndex(other.getPartIndex()); + } + if (other.getStartIndex() != 0) { + setStartIndex(other.getStartIndex()); + } + if (other.getEndIndex() != 0) { + setEndIndex(other.getEndIndex()); + } + if (!other.getText().isEmpty()) { + text_ = other.text_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + partIndex_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + startIndex_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + endIndex_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + text_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int partIndex_; + /** + * + * + *
+     * Output only. The index of a Part object within its parent Content object.
+     * 
+ * + * int32 part_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The partIndex. + */ + @java.lang.Override + public int getPartIndex() { + return partIndex_; + } + /** + * + * + *
+     * Output only. The index of a Part object within its parent Content object.
+     * 
+ * + * int32 part_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The partIndex to set. + * @return This builder for chaining. + */ + public Builder setPartIndex(int value) { + + partIndex_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The index of a Part object within its parent Content object.
+     * 
+ * + * int32 part_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPartIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + partIndex_ = 0; + onChanged(); + return this; + } + + private int startIndex_; + /** + * + * + *
+     * Output only. Start index in the given Part, measured in bytes. Offset from
+     * the start of the Part, inclusive, starting at zero.
+     * 
+ * + * int32 start_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The startIndex. + */ + @java.lang.Override + public int getStartIndex() { + return startIndex_; + } + /** + * + * + *
+     * Output only. Start index in the given Part, measured in bytes. Offset from
+     * the start of the Part, inclusive, starting at zero.
+     * 
+ * + * int32 start_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The startIndex to set. + * @return This builder for chaining. + */ + public Builder setStartIndex(int value) { + + startIndex_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Start index in the given Part, measured in bytes. Offset from
+     * the start of the Part, inclusive, starting at zero.
+     * 
+ * + * int32 start_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStartIndex() { + bitField0_ = (bitField0_ & ~0x00000002); + startIndex_ = 0; + onChanged(); + return this; + } + + private int endIndex_; + /** + * + * + *
+     * Output only. End index in the given Part, measured in bytes. Offset from
+     * the start of the Part, exclusive, starting at zero.
+     * 
+ * + * int32 end_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The endIndex. + */ + @java.lang.Override + public int getEndIndex() { + return endIndex_; + } + /** + * + * + *
+     * Output only. End index in the given Part, measured in bytes. Offset from
+     * the start of the Part, exclusive, starting at zero.
+     * 
+ * + * int32 end_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The endIndex to set. + * @return This builder for chaining. + */ + public Builder setEndIndex(int value) { + + endIndex_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. End index in the given Part, measured in bytes. Offset from
+     * the start of the Part, exclusive, starting at zero.
+     * 
+ * + * int32 end_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearEndIndex() { + bitField0_ = (bitField0_ & ~0x00000004); + endIndex_ = 0; + onChanged(); + return this; + } + + private java.lang.Object text_ = ""; + /** + * + * + *
+     * Output only. The text corresponding to the segment from the response.
+     * 
+ * + * string text = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The text corresponding to the segment from the response.
+     * 
+ * + * string text = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The text corresponding to the segment from the response.
+     * 
+ * + * string text = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + text_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The text corresponding to the segment from the response.
+     * 
+ * + * string text = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearText() { + text_ = getDefaultInstance().getText(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The text corresponding to the segment from the response.
+     * 
+ * + * string text = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + text_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1.Segment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1.Segment) + private static final com.google.cloud.vertexai.api.Segment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.Segment(); + } + + public static com.google.cloud.vertexai.api.Segment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Segment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.vertexai.api.Segment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/SegmentOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/SegmentOrBuilder.java new file mode 100644 index 000000000000..6a101a736d96 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/SegmentOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/vertexai/v1/content.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.vertexai.api; + +public interface SegmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.vertexai.v1.Segment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The index of a Part object within its parent Content object.
+   * 
+ * + * int32 part_index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The partIndex. + */ + int getPartIndex(); + + /** + * + * + *
+   * Output only. Start index in the given Part, measured in bytes. Offset from
+   * the start of the Part, inclusive, starting at zero.
+   * 
+ * + * int32 start_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The startIndex. + */ + int getStartIndex(); + + /** + * + * + *
+   * Output only. End index in the given Part, measured in bytes. Offset from
+   * the start of the Part, exclusive, starting at zero.
+   * 
+ * + * int32 end_index = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The endIndex. + */ + int getEndIndex(); + + /** + * + * + *
+   * Output only. The text corresponding to the segment from the response.
+   * 
+ * + * string text = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The text. + */ + java.lang.String getText(); + /** + * + * + *
+   * Output only. The text corresponding to the segment from the response.
+   * 
+ * + * string text = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ServiceNetworkingProto.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ServiceNetworkingProto.java index c9de1f304e12..c67c5e1f96d2 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ServiceNetworkingProto.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ServiceNetworkingProto.java @@ -48,17 +48,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n1google/cloud/vertexai/v1/service_netwo" + "rking.proto\022\030google.cloud.vertexai.v1\032\037g" + "oogle/api/field_behavior.proto\032\031google/a" - + "pi/resource.proto\"e\n\033PrivateServiceConne" - + "ctConfig\022+\n\036enable_private_service_conne" - + "ct\030\001 \001(\010B\003\340A\002\022\031\n\021project_allowlist\030\002 \003(\t" - + "\"S\n\025PscAutomatedEndpoints\022\022\n\nproject_id\030" - + "\001 \001(\t\022\017\n\007network\030\002 \001(\t\022\025\n\rmatch_address\030" - + "\003 \001(\tB\323\001\n\035com.google.cloud.vertexai.apiB" - + "\026ServiceNetworkingProtoP\001Z>cloud.google." - + "com/go/aiplatform/apiv1/aiplatformpb;aip" - + "latformpb\252\002\032Google.Cloud.AIPlatform.V1\312\002" - + "\032Google\\Cloud\\AIPlatform\\V1\352\002\035Google::Cl" - + "oud::AIPlatform::V1b\006proto3" + + "pi/resource.proto\"\206\001\n\033PrivateServiceConn" + + "ectConfig\022+\n\036enable_private_service_conn" + + "ect\030\001 \001(\010B\003\340A\002\022\031\n\021project_allowlist\030\002 \003(" + + "\t\022\037\n\022service_attachment\030\005 \001(\tB\003\340A\003\"S\n\025Ps" + + "cAutomatedEndpoints\022\022\n\nproject_id\030\001 \001(\t\022" + + "\017\n\007network\030\002 \001(\t\022\025\n\rmatch_address\030\003 \001(\tB" + + "\314\002\n\035com.google.cloud.vertexai.apiB\026Servi" + + "ceNetworkingProtoP\001Z>cloud.google.com/go" + + "/aiplatform/apiv1/aiplatformpb;aiplatfor" + + "mpb\252\002\032Google.Cloud.AIPlatform.V1\312\002\032Googl" + + "e\\Cloud\\AIPlatform\\V1\352\002\035Google::Cloud::A" + + "IPlatform::V1\352Av\n(compute.googleapis.com" + + "/NetworkAttachment\022Jprojects/{project}/r" + + "egions/{region}/networkAttachments/{netw" + + "orkattachment}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -73,7 +77,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_vertexai_v1_PrivateServiceConnectConfig_descriptor, new java.lang.String[] { - "EnablePrivateServiceConnect", "ProjectAllowlist", + "EnablePrivateServiceConnect", "ProjectAllowlist", "ServiceAttachment", }); internal_static_google_cloud_vertexai_v1_PscAutomatedEndpoints_descriptor = getDescriptor().getMessageTypes().get(1); @@ -86,6 +90,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceDefinition); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/TokensInfo.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/TokensInfo.java index 5677f9caac90..5a06c91be38a 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/TokensInfo.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/TokensInfo.java @@ -41,6 +41,7 @@ private TokensInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { private TokensInfo() { tokens_ = emptyList(com.google.protobuf.ByteString.class); tokenIds_ = emptyLongList(); + role_ = ""; } @java.lang.Override @@ -165,6 +166,57 @@ public long getTokenIds(int index) { private int tokenIdsMemoizedSerializedSize = -1; + public static final int ROLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object role_ = ""; + /** + * + * + *
+   * Optional. Optional fields for the role from the corresponding Content.
+   * 
+ * + * string role = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The role. + */ + @java.lang.Override + public java.lang.String getRole() { + java.lang.Object ref = role_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + role_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Optional fields for the role from the corresponding Content.
+   * 
+ * + * string role = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for role. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRoleBytes() { + java.lang.Object ref = role_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + role_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -190,6 +242,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < tokenIds_.size(); i++) { output.writeInt64NoTag(tokenIds_.getLong(i)); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, role_); + } getUnknownFields().writeTo(output); } @@ -220,6 +275,9 @@ public int getSerializedSize() { } tokenIdsMemoizedSerializedSize = dataSize; } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, role_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -237,6 +295,7 @@ public boolean equals(final java.lang.Object obj) { if (!getTokensList().equals(other.getTokensList())) return false; if (!getTokenIdsList().equals(other.getTokenIdsList())) return false; + if (!getRole().equals(other.getRole())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -256,6 +315,8 @@ public int hashCode() { hash = (37 * hash) + TOKEN_IDS_FIELD_NUMBER; hash = (53 * hash) + getTokenIdsList().hashCode(); } + hash = (37 * hash) + ROLE_FIELD_NUMBER; + hash = (53 * hash) + getRole().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -397,6 +458,7 @@ public Builder clear() { bitField0_ = 0; tokens_ = emptyList(com.google.protobuf.ByteString.class); tokenIds_ = emptyLongList(); + role_ = ""; return this; } @@ -441,6 +503,9 @@ private void buildPartial0(com.google.cloud.vertexai.api.TokensInfo result) { tokenIds_.makeImmutable(); result.tokenIds_ = tokenIds_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.role_ = role_; + } } @java.lang.Override @@ -510,6 +575,11 @@ public Builder mergeFrom(com.google.cloud.vertexai.api.TokensInfo other) { } onChanged(); } + if (!other.getRole().isEmpty()) { + role_ = other.role_; + bitField0_ |= 0x00000004; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -561,6 +631,12 @@ public Builder mergeFrom( input.popLimit(limit); break; } // case 18 + case 26: + { + role_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -846,6 +922,112 @@ public Builder clearTokenIds() { return this; } + private java.lang.Object role_ = ""; + /** + * + * + *
+     * Optional. Optional fields for the role from the corresponding Content.
+     * 
+ * + * string role = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The role. + */ + public java.lang.String getRole() { + java.lang.Object ref = role_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + role_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Optional fields for the role from the corresponding Content.
+     * 
+ * + * string role = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for role. + */ + public com.google.protobuf.ByteString getRoleBytes() { + java.lang.Object ref = role_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + role_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Optional fields for the role from the corresponding Content.
+     * 
+ * + * string role = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The role to set. + * @return This builder for chaining. + */ + public Builder setRole(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + role_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional fields for the role from the corresponding Content.
+     * 
+ * + * string role = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRole() { + role_ = getDefaultInstance().getRole(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional fields for the role from the corresponding Content.
+     * 
+ * + * string role = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for role to set. + * @return This builder for chaining. + */ + public Builder setRoleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + role_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/TokensInfoOrBuilder.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/TokensInfoOrBuilder.java index bcb10e0b2c44..af0297a4af35 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/TokensInfoOrBuilder.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/TokensInfoOrBuilder.java @@ -99,4 +99,29 @@ public interface TokensInfoOrBuilder * @return The tokenIds at the given index. */ long getTokenIds(int index); + + /** + * + * + *
+   * Optional. Optional fields for the role from the corresponding Content.
+   * 
+ * + * string role = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The role. + */ + java.lang.String getRole(); + /** + * + * + *
+   * Optional. Optional fields for the role from the corresponding Content.
+   * 
+ * + * string role = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for role. + */ + com.google.protobuf.ByteString getRoleBytes(); } diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ToolProto.java b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ToolProto.java index c977e34d9fe9..a65c0d7a5450 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ToolProto.java +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ToolProto.java @@ -91,24 +91,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "rgs\030\002 \001(\0132\027.google.protobuf.StructB\003\340A\001\"" + "U\n\020FunctionResponse\022\021\n\004name\030\001 \001(\tB\003\340A\002\022." + "\n\010response\030\002 \001(\0132\027.google.protobuf.Struc" - + "tB\003\340A\002\"}\n\tRetrieval\022D\n\020vertex_ai_search\030" + + "tB\003\340A\002\"\177\n\tRetrieval\022D\n\020vertex_ai_search\030" + "\002 \001(\0132(.google.cloud.vertexai.v1.VertexA" - + "ISearchH\000\022 \n\023disable_attribution\030\003 \001(\010B\003" - + "\340A\001B\010\n\006source\"(\n\016VertexAISearch\022\026\n\tdatas" - + "tore\030\001 \001(\tB\003\340A\002\"\027\n\025GoogleSearchRetrieval" - + "\"c\n\nToolConfig\022U\n\027function_calling_confi" - + "g\030\001 \001(\0132/.google.cloud.vertexai.v1.Funct" - + "ionCallingConfigB\003\340A\001\"\300\001\n\025FunctionCallin" - + "gConfig\022G\n\004mode\030\001 \001(\01624.google.cloud.ver" - + "texai.v1.FunctionCallingConfig.ModeB\003\340A\001" - + "\022#\n\026allowed_function_names\030\002 \003(\tB\003\340A\001\"9\n" - + "\004Mode\022\024\n\020MODE_UNSPECIFIED\020\000\022\010\n\004AUTO\020\001\022\007\n" - + "\003ANY\020\002\022\010\n\004NONE\020\003B\306\001\n\035com.google.cloud.ve" - + "rtexai.apiB\tToolProtoP\001Z>cloud.google.co" - + "m/go/aiplatform/apiv1/aiplatformpb;aipla" - + "tformpb\252\002\032Google.Cloud.AIPlatform.V1\312\002\032G" - + "oogle\\Cloud\\AIPlatform\\V1\352\002\035Google::Clou" - + "d::AIPlatform::V1b\006proto3" + + "ISearchH\000\022\"\n\023disable_attribution\030\003 \001(\010B\005" + + "\030\001\340A\001B\010\n\006source\"(\n\016VertexAISearch\022\026\n\tdat" + + "astore\030\001 \001(\tB\003\340A\002\"\027\n\025GoogleSearchRetriev" + + "al\"c\n\nToolConfig\022U\n\027function_calling_con" + + "fig\030\001 \001(\0132/.google.cloud.vertexai.v1.Fun" + + "ctionCallingConfigB\003\340A\001\"\300\001\n\025FunctionCall" + + "ingConfig\022G\n\004mode\030\001 \001(\01624.google.cloud.v" + + "ertexai.v1.FunctionCallingConfig.ModeB\003\340" + + "A\001\022#\n\026allowed_function_names\030\002 \003(\tB\003\340A\001\"" + + "9\n\004Mode\022\024\n\020MODE_UNSPECIFIED\020\000\022\010\n\004AUTO\020\001\022" + + "\007\n\003ANY\020\002\022\010\n\004NONE\020\003B\306\001\n\035com.google.cloud." + + "vertexai.apiB\tToolProtoP\001Z>cloud.google." + + "com/go/aiplatform/apiv1/aiplatformpb;aip" + + "latformpb\252\002\032Google.Cloud.AIPlatform.V1\312\002" + + "\032Google\\Cloud\\AIPlatform\\V1\352\002\035Google::Cl" + + "oud::AIPlatform::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/accelerator_type.proto b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/accelerator_type.proto index 73faab61141a..f70e714c5e00 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/accelerator_type.proto +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/accelerator_type.proto @@ -29,8 +29,9 @@ enum AcceleratorType { // Unspecified accelerator type, which means no accelerator. ACCELERATOR_TYPE_UNSPECIFIED = 0; - // Nvidia Tesla K80 GPU. - NVIDIA_TESLA_K80 = 1; + // Deprecated: Nvidia Tesla K80 GPU has reached end of support, + // see https://cloud.google.com/compute/docs/eol/k80-eol. + NVIDIA_TESLA_K80 = 1 [deprecated = true]; // Nvidia Tesla P100 GPU. NVIDIA_TESLA_P100 = 2; diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/content.proto b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/content.proto index 4e0eddd4fa46..c091456fb830 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/content.proto +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/content.proto @@ -137,6 +137,48 @@ message VideoMetadata { // Generation config. message GenerationConfig { + // The configuration for routing the request to a specific model. + message RoutingConfig { + // When automated routing is specified, the routing will be determined by + // the pretrained routing model and customer provided model routing + // preference. + message AutoRoutingMode { + // The model routing preference. + enum ModelRoutingPreference { + // Unspecified model routing preference. + UNKNOWN = 0; + + // Prefer higher quality over low cost. + PRIORITIZE_QUALITY = 1; + + // Balanced model routing preference. + BALANCED = 2; + + // Prefer lower cost over higher quality. + PRIORITIZE_COST = 3; + } + + // The model routing preference. + optional ModelRoutingPreference model_routing_preference = 1; + } + + // When manual routing is set, the specified model will be used directly. + message ManualRoutingMode { + // The model name to use. Only the public LLM models are accepted. e.g. + // 'gemini-1.5-pro-001'. + optional string model_name = 1; + } + + // Routing mode. + oneof routing_config { + // Automated routing. + AutoRoutingMode auto_mode = 1; + + // Manual routing. + ManualRoutingMode manual_mode = 2; + } + } + // Optional. Controls the randomness of predictions. optional float temperature = 1 [(google.api.field_behavior) = OPTIONAL]; @@ -161,6 +203,9 @@ message GenerationConfig { // Optional. Frequency penalties. optional float frequency_penalty = 9 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Seed. + optional int32 seed = 12 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Output response mimetype of the generated candidate text. // Supported mimetype: // - `text/plain`: (default) Text output. @@ -178,6 +223,10 @@ message GenerationConfig { // Compatible mimetypes: // `application/json`: Schema for JSON response. optional Schema response_schema = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Routing configuration. + optional RoutingConfig routing_config = 17 + [(google.api.field_behavior) = OPTIONAL]; } // Safety settings. @@ -198,6 +247,9 @@ message SafetySetting { // Block none. BLOCK_NONE = 4; + + // Turn off the safety filter. + OFF = 5; } // Probability vs severity. @@ -317,35 +369,38 @@ message Candidate { // The finish reason is unspecified. FINISH_REASON_UNSPECIFIED = 0; - // Natural stop point of the model or provided stop sequence. + // Token generation reached a natural stopping point or a configured stop + // sequence. STOP = 1; - // The maximum number of tokens as specified in the request was reached. + // Token generation reached the configured maximum output tokens. MAX_TOKENS = 2; - // The token generation was stopped as the response was flagged for safety - // reasons. NOTE: When streaming the Candidate.content will be empty if - // content filters blocked the output. + // Token generation stopped because the content potentially contains safety + // violations. NOTE: When streaming, + // [content][google.cloud.aiplatform.v1.Candidate.content] is empty if + // content filters blocks the output. SAFETY = 3; - // The token generation was stopped as the response was flagged for - // unauthorized citations. + // Token generation stopped because the content potentially contains + // copyright violations. RECITATION = 4; - // All other reasons that stopped the token generation + // All other reasons that stopped the token generation. OTHER = 5; - // The token generation was stopped as the response was flagged for the - // terms which are included from the terminology blocklist. + // Token generation stopped because the content contains forbidden terms. BLOCKLIST = 6; - // The token generation was stopped as the response was flagged for - // the prohibited contents. + // Token generation stopped for potentially containing prohibited content. PROHIBITED_CONTENT = 7; - // The token generation was stopped as the response was flagged for - // Sensitive Personally Identifiable Information (SPII) contents. + // Token generation stopped because the content potentially contains + // Sensitive Personally Identifiable Information (SPII). SPII = 8; + + // The function call generated by the model is invalid. + MALFORMED_FUNCTION_CALL = 9; } // Output only. Index of the candidate. @@ -354,6 +409,12 @@ message Candidate { // Output only. Content parts of the candidate. Content content = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Confidence score of the candidate. + double score = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Average log probability score of the candidate. + double avg_logprobs = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The reason why the model stopped generating tokens. // If empty, the model has not stopped generating the tokens. FinishReason finish_reason = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -378,6 +439,70 @@ message Candidate { [(google.api.field_behavior) = OUTPUT_ONLY]; } +// Segment of the content. +message Segment { + // Output only. The index of a Part object within its parent Content object. + int32 part_index = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Start index in the given Part, measured in bytes. Offset from + // the start of the Part, inclusive, starting at zero. + int32 start_index = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. End index in the given Part, measured in bytes. Offset from + // the start of the Part, exclusive, starting at zero. + int32 end_index = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The text corresponding to the segment from the response. + string text = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Grounding chunk. +message GroundingChunk { + // Chunk from the web. + message Web { + // URI reference of the chunk. + optional string uri = 1; + + // Title of the chunk. + optional string title = 2; + } + + // Chunk from context retrieved by the retrieval tools. + message RetrievedContext { + // URI reference of the attribution. + optional string uri = 1; + + // Title of the attribution. + optional string title = 2; + } + + // Chunk type. + oneof chunk_type { + // Grounding chunk from the web. + Web web = 1; + + // Grounding chunk from context retrieved by the retrieval tools. + RetrievedContext retrieved_context = 2; + } +} + +// Grounding support. +message GroundingSupport { + // Segment of the content this support belongs to. + optional Segment segment = 1; + + // A list of indices (into 'grounding_chunk') specifying the + // citations associated with the claim. For instance [1,3,4] means + // that grounding_chunk[1], grounding_chunk[3], + // grounding_chunk[4] are the retrieved content attributed to the claim. + repeated int32 grounding_chunk_indices = 2; + + // Confidence score of the support references. Ranges from 0 to 1. 1 is the + // most confident. This list must have the same size as the + // grounding_chunk_indices. + repeated float confidence_scores = 3; +} + // Metadata returned to client when grounding is enabled. message GroundingMetadata { // Optional. Web search queries for the following-up web search. @@ -387,6 +512,13 @@ message GroundingMetadata { // Optional. Google search entry for the following-up web searches. optional SearchEntryPoint search_entry_point = 4 [(google.api.field_behavior) = OPTIONAL]; + + // List of supporting references retrieved from specified grounding source. + repeated GroundingChunk grounding_chunks = 5; + + // Optional. List of grounding support. + repeated GroundingSupport grounding_supports = 6 + [(google.api.field_behavior) = OPTIONAL]; } // Google search entry point. diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/endpoint.proto b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/endpoint.proto index 943b37396437..67c05971f37b 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/endpoint.proto +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/endpoint.proto @@ -150,6 +150,28 @@ message Endpoint { // Configures the request-response logging for online prediction. PredictRequestResponseLoggingConfig predict_request_response_logging_config = 18; + + // If true, the endpoint will be exposed through a dedicated + // DNS [Endpoint.dedicated_endpoint_dns]. Your request to the dedicated DNS + // will be isolated from other users' traffic and will have better performance + // and reliability. + // Note: Once you enabled dedicated endpoint, you won't be able to send + // request to the shared DNS {region}-aiplatform.googleapis.com. The + // limitation will be removed soon. + bool dedicated_endpoint_enabled = 24; + + // Output only. DNS of the dedicated endpoint. Will only be populated if + // dedicated_endpoint_enabled is true. + // Format: + // `https://{endpoint_id}.{region}-{project_number}.prediction.vertexai.goog`. + string dedicated_endpoint_dns = 25 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 28 [(google.api.field_behavior) = OUTPUT_ONLY]; } // A deployment of a Model. Endpoints contain one or more DeployedModels. diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/llm_utility_service.proto b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/llm_utility_service.proto index 12c86c0ba9e3..6b7ff112cc73 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/llm_utility_service.proto +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/llm_utility_service.proto @@ -20,6 +20,7 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/vertexai/v1/content.proto"; import "google/cloud/vertexai/v1/prediction_service.proto"; import "google/protobuf/struct.proto"; @@ -46,6 +47,14 @@ service LlmUtilityService { post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:countTokens" body: "*" } + additional_bindings { + post: "/v1/{endpoint=endpoints/*}:countTokens" + body: "*" + } + additional_bindings { + post: "/v1/{endpoint=publishers/*/models/*}:countTokens" + body: "*" + } }; option (google.api.method_signature) = "endpoint,instances"; } @@ -59,6 +68,14 @@ service LlmUtilityService { post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:computeTokens" body: "*" } + additional_bindings { + post: "/v1/{endpoint=endpoints/*}:computeTokens" + body: "*" + } + additional_bindings { + post: "/v1/{endpoint=publishers/*/models/*}:computeTokens" + body: "*" + } }; option (google.api.method_signature) = "endpoint,instances"; } @@ -75,11 +92,19 @@ message ComputeTokensRequest { } ]; - // Required. The instances that are the input to token computing API call. + // Optional. The instances that are the input to token computing API call. // Schema is identical to the prediction schema of the text model, even for // the non-text models, like chat models, or Codey models. repeated google.protobuf.Value instances = 2 - [(google.api.field_behavior) = REQUIRED]; + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the publisher model requested to serve the + // prediction. Format: + // projects/{project}/locations/{location}/publishers/*/models/* + string model = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input content. + repeated Content contents = 4 [(google.api.field_behavior) = OPTIONAL]; } // Tokens info with a list of tokens and the corresponding list of token ids. @@ -89,6 +114,9 @@ message TokensInfo { // A list of token ids from the input. repeated int64 token_ids = 2; + + // Optional. Optional fields for the role from the corresponding Content. + string role = 3 [(google.api.field_behavior) = OPTIONAL]; } // Response message for ComputeTokens RPC call. diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/machine_resources.proto b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/machine_resources.proto index 751a96a952cf..8fe69ae25fc6 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/machine_resources.proto +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/machine_resources.proto @@ -18,6 +18,7 @@ package google.cloud.vertexai.v1; import "google/api/field_behavior.proto"; import "google/cloud/vertexai/v1/accelerator_type.proto"; +import "google/cloud/vertexai/v1/reservation_affinity.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1"; option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; @@ -56,6 +57,13 @@ message MachineSpec { // Immutable. The topology of the TPUs. Corresponds to the TPU topologies // available from GKE. (Example: tpu_topology: "2x2x1"). string tpu_topology = 4 [(google.api.field_behavior) = IMMUTABLE]; + + // Optional. Immutable. Configuration controlling how this resource pool + // consumes reservation. + ReservationAffinity reservation_affinity = 5 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; } // A description of resources that are dedicated to a DeployedModel, and @@ -121,6 +129,10 @@ message DedicatedResources { // to `80`. repeated AutoscalingMetricSpec autoscaling_metric_specs = 4 [(google.api.field_behavior) = IMMUTABLE]; + + // Optional. If true, schedule the deployment workload on [spot + // VMs](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms). + bool spot = 5 [(google.api.field_behavior) = OPTIONAL]; } // A description of resources that to large degree are decided by Vertex AI, diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/prediction_service.proto b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/prediction_service.proto index bdc2d2458352..1fb2ca32297e 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/prediction_service.proto +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/prediction_service.proto @@ -98,10 +98,6 @@ service PredictionService { option (google.api.http) = { post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:directPredict" body: "*" - additional_bindings { - post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:directPredict" - body: "*" - } }; } @@ -112,40 +108,18 @@ service PredictionService { option (google.api.http) = { post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:directRawPredict" body: "*" - additional_bindings { - post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:directRawPredict" - body: "*" - } }; } // Perform a streaming online prediction request to a gRPC model server for // Vertex first-party products and frameworks. rpc StreamDirectPredict(stream StreamDirectPredictRequest) - returns (stream StreamDirectPredictResponse) { - option (google.api.http) = { - post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:streamDirectPredict" - body: "*" - additional_bindings { - post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamDirectPredict" - body: "*" - } - }; - } + returns (stream StreamDirectPredictResponse) {} // Perform a streaming online prediction request to a gRPC model server for // custom containers. rpc StreamDirectRawPredict(stream StreamDirectRawPredictRequest) - returns (stream StreamDirectRawPredictResponse) { - option (google.api.http) = { - post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:streamDirectRawPredict" - body: "*" - additional_bindings { - post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamDirectRawPredict" - body: "*" - } - }; - } + returns (stream StreamDirectRawPredictResponse) {} // Perform a streaming online prediction request for Vertex first-party // products and frameworks. @@ -200,6 +174,14 @@ service PredictionService { post: "/v1/{model=projects/*/locations/*/publishers/*/models/*}:generateContent" body: "*" } + additional_bindings { + post: "/v1/{model=endpoints/*}:generateContent" + body: "*" + } + additional_bindings { + post: "/v1/{model=publishers/*/models/*}:generateContent" + body: "*" + } }; option (google.api.method_signature) = "model,contents"; } @@ -214,6 +196,14 @@ service PredictionService { post: "/v1/{model=projects/*/locations/*/publishers/*/models/*}:streamGenerateContent" body: "*" } + additional_bindings { + post: "/v1/{model=endpoints/*}:streamGenerateContent" + body: "*" + } + additional_bindings { + post: "/v1/{model=publishers/*/models/*}:streamGenerateContent" + body: "*" + } }; option (google.api.method_signature) = "model,contents"; } @@ -637,18 +627,32 @@ message CountTokensRequest { } ]; - // Required. The name of the publisher model requested to serve the + // Optional. The name of the publisher model requested to serve the // prediction. Format: // `projects/{project}/locations/{location}/publishers/*/models/*` - string model = 3 [(google.api.field_behavior) = REQUIRED]; + string model = 3 [(google.api.field_behavior) = OPTIONAL]; - // Required. The instances that are the input to token counting call. + // Optional. The instances that are the input to token counting call. // Schema is identical to the prediction schema of the underlying model. repeated google.protobuf.Value instances = 2 - [(google.api.field_behavior) = REQUIRED]; + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input content. + repeated Content contents = 4 [(google.api.field_behavior) = OPTIONAL]; - // Required. Input content. - repeated Content contents = 4 [(google.api.field_behavior) = REQUIRED]; + // Optional. The user provided system instructions for the model. + // Note: only text should be used in parts and content in each part will be in + // a separate paragraph. + optional Content system_instruction = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of `Tools` the model may use to generate the next + // response. + // + // A `Tool` is a piece of code that enables the system to interact with + // external systems to perform an action, or set of actions, outside of + // knowledge and scope of the model. + repeated Tool tools = 6 [(google.api.field_behavior) = OPTIONAL]; } // Response message for [PredictionService.CountTokens][]. @@ -663,9 +667,14 @@ message CountTokensResponse { // Request message for [PredictionService.GenerateContent]. message GenerateContentRequest { - // Required. The name of the publisher model requested to serve the - // prediction. Format: + // Required. The fully qualified name of the publisher model or tuned model + // endpoint to use. + // + // Publisher model format: // `projects/{project}/locations/{location}/publishers/*/models/*` + // + // Tuned model endpoint format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` string model = 5 [(google.api.field_behavior) = REQUIRED]; // Required. The content of the current conversation with the model. @@ -739,7 +748,9 @@ message GenerateContentResponse { // Usage metadata about response(s). message UsageMetadata { - // Number of tokens in the request. + // Number of tokens in the request. When `cached_content` is set, this is + // still the total effective prompt size meaning this includes the number of + // tokens in the cached content. int32 prompt_token_count = 1; // Number of tokens in the response(s). diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/reservation_affinity.proto b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/reservation_affinity.proto new file mode 100644 index 000000000000..5d31c6746f99 --- /dev/null +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/reservation_affinity.proto @@ -0,0 +1,71 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.vertexai.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "ReservationAffinityProto"; +option java_package = "com.google.cloud.vertexai.api"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Reservation" + pattern: "projects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}" +}; + +// A ReservationAffinity can be used to configure a Vertex AI resource (e.g., a +// DeployedModel) to draw its Compute Engine resources from a Shared +// Reservation, or exclusively from on-demand capacity. +message ReservationAffinity { + // Identifies a type of reservation affinity. + enum Type { + // Default value. This should not be used. + TYPE_UNSPECIFIED = 0; + + // Do not consume from any reserved capacity, only use on-demand. + NO_RESERVATION = 1; + + // Consume any reservation available, falling back to on-demand. + ANY_RESERVATION = 2; + + // Consume from a specific reservation. When chosen, the reservation + // must be identified via the `key` and `values` fields. + SPECIFIC_RESERVATION = 3; + } + + // Required. Specifies the reservation affinity type. + Type reservation_affinity_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Corresponds to the label key of a reservation resource. To target + // a SPECIFIC_RESERVATION by name, use + // `compute.googleapis.com/reservation-name` as the key and specify the name + // of your reservation as its value. + string key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Corresponds to the label values of a reservation resource. This + // must be the full resource name of the reservation. + repeated string values = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Reservation" + } + ]; +} diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/service_networking.proto b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/service_networking.proto index 0c78d568241e..fe873787f5a0 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/service_networking.proto +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/service_networking.proto @@ -26,6 +26,10 @@ option java_outer_classname = "ServiceNetworkingProto"; option java_package = "com.google.cloud.vertexai.api"; option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; option ruby_package = "Google::Cloud::AIPlatform::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/NetworkAttachment" + pattern: "projects/{project}/regions/{region}/networkAttachments/{networkattachment}" +}; // Represents configuration for private service connect. message PrivateServiceConnectConfig { @@ -36,6 +40,11 @@ message PrivateServiceConnectConfig { // A list of Projects from which the forwarding rule will target the service // attachment. repeated string project_allowlist = 2; + + // Output only. The name of the generated service attachment resource. + // This is only populated if the endpoint is deployed with + // PrivateServiceConnect. + string service_attachment = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; } // PscAutomatedEndpoints defines the output of the forwarding rule diff --git a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/tool.proto b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/tool.proto index ebe5d40dd3e3..61fc30d9305c 100644 --- a/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/tool.proto +++ b/java-vertexai/proto-google-cloud-vertexai-v1/src/main/proto/google/cloud/vertexai/v1/tool.proto @@ -127,10 +127,9 @@ message Retrieval { VertexAISearch vertex_ai_search = 2; } - // Optional. Disable using the result from this tool in detecting grounding - // attribution. This does not affect how the result is given to the model for - // generation. - bool disable_attribution = 3 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Deprecated. This option is no longer supported. + bool disable_attribution = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; } // Retrieve from Vertex AI Search datastore for grounding. @@ -160,7 +159,7 @@ message FunctionCallingConfig { MODE_UNSPECIFIED = 0; // Default model behavior, model decides to predict either a function call - // or a natural language repspose. + // or a natural language response. AUTO = 1; // Model is constrained to always predicting a function call only.