8000 feat(vertexai): upgrade to protobuf 4.33.0 by diegomarquezp · Pull Request #11830 · googleapis/google-cloud-java · GitHub
[go: up one dir, main page]

Skip to content
Draft
Show file tree
Hide file tree
Changes from 8000 all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
8000
  •  
  •  
  •  
400 changes: 200 additions & 200 deletions gapic-libraries-bom/pom.xml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions google-cloud-jar-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-bom</artifactId>
<version>4.33.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-shared-dependencies</artifactId>
Expand Down
51 changes: 51 additions & 0 deletions java-vertexai/google-cloud-vertexai/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
description = 'GAPIC library for gapic-google-cloud-vertexai-v1beta1-java'
group = 'com.google.cloud'
version = (version == 'unspecified') ? '0.0.0-SNAPSHOT' : version

compileJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'

dependencies {
api 'com.google.api:gax:2.37.0'
testImplementation 'com.google.api:gax:2.37.0:testlib'
api 'com.google.api:gax-grpc:2.37.0'
testImplementation 'com.google.api:gax-grpc:2.37.0:testlib'
api 'com.google.api:gax-httpjson:2.37.0'
testImplementation 'com.google.api:gax-httpjson:2.37.0:testlib'
api 'io.grpc:grpc-protobuf:1.59.0'
testImplementation 'io.grpc:grpc-stub:1.59.0'
testImplementation 'io.grpc:grpc-netty-shaded:1.59.0'
testImplementation 'junit:junit:4.13.2'

// TODO: remove when dropping Java 8 support.
// https://github.com/googleapis/gapic-generator-java/issues/888
implementation 'javax.annotation:javax.annotation-api:1.3.2'

api project(':proto-google-cloud-vertexai-v1beta1-java')
api 'com.google.api.grpc:proto-google-iam-v1:1.22.0'
testImplementation project(':grpc-google-cloud-vertexai-v1beta1-java')
testImplementation 'com.google.api.grpc:grpc-google-common-protos:2.27.0'
testImplementation 'com.google.api.grpc:grpc-google-iam-v1:1.22.0'
}

task smokeTest(type: Test) {
filter {
includeTestsMatching "*SmokeTest"
setFailOnNoMatchingTests false
}
}

test {
exclude "**/*SmokeTest*"
}

clean {
delete 'all-jars'
}

task allJars(type: Copy) {
dependsOn test, jar
into 'all-jars'
// Replace with `from configurations.testRuntimeClasspath, jar` to include test dependencies
from configurations.runtimeClasspath, jar
}
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
* </tr>
* <tr>
* <td><p> MutateDeployedModel</td>
* <td><p> Updates an existing deployed model. Updatable fields include `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and `enable_container_logging` (v1beta1 only).</td>
* <td><p> Updates an existing deployed model. Updatable fields include `min_replica_count`, `max_replica_count`, `required_replica_count`, `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and `enable_container_logging` (v1beta1 only).</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
Expand Down Expand Up @@ -1773,8 +1773,8 @@ public final UnaryCallable<UndeployModelRequest, Operation> undeployModelCallabl
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an existing deployed model. Updatable fields include `min_replica_count`,
* `max_replica_count`, `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and
* `enable_container_logging` (v1beta1 only).
* `max_replica_count`, `required_replica_count`, `autoscaling_metric_specs`,
* `disable_container_logging` (v1 only), and `enable_container_logging` (v1beta1 only).
*
* <p>Sample code:
*
Expand Down Expand Up @@ -1805,6 +1805,8 @@ public final UnaryCallable<UndeployModelRequest, Operation> undeployModelCallabl
* <li>`max_replica_count` in either
* [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] or
* [AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources]
* <li>`required_replica_count` in
* [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources]
* <li>[autoscaling_metric_specs][google.cloud.aiplatform.v1.DedicatedResources.autoscaling_metric_specs]
* <li>`disable_container_logging` (v1 only)
* <li>`enable_container_logging` (v1beta1 only)
Expand All @@ -1829,8 +1831,8 @@ public final UnaryCallable<UndeployModelRequest, Operation> undeployModelCallabl
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an existing deployed model. Updatable fields include `min_replica_count`,
* `max_replica_count`, `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and
* `enable_container_logging` (v1beta1 only).
* `max_replica_count`, `required_replica_count`, `autoscaling_metric_specs`,
* `disable_container_logging` (v1 only), and 7440 `enable_container_logging` (v1beta1 only).
*
* <p>Sample code:
*
Expand Down Expand Up @@ -1862,6 +1864,8 @@ public final UnaryCallable<UndeployModelRequest, Operation> undeployModelCallabl
* <li>`max_replica_count` in either
* [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] or
* [AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources]
* <li>`required_replica_count` in
* [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources]
* <li>[autoscaling_metric_specs][google.cloud.aiplatform.v1.DedicatedResources.autoscaling_metric_specs]
* <li>`disable_container_logging` (v1 only)
* <li>`enable_container_logging` (v1beta1 only)
Expand All @@ -1885,8 +1889,8 @@ public final UnaryCallable<UndeployModelRequest, Operation> undeployModelCallabl
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an existing deployed model. Updatable fields include `min_replica_count`,
* `max_replica_count`, `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and
* `enable_container_logging` (v1beta1 only).
* `max_replica_count`, `required_replica_count`, `autoscaling_metric_specs`,
* `disable_container_logging` (v1 only), and `enable_container_logging` (v1beta1 only).
*
* <p>Sample code:
*
Expand Down Expand Up @@ -1922,8 +1926,8 @@ public final UnaryCallable<UndeployModelRequest, Operation> undeployModelCallabl
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an existing deployed model. Updatable fields include `min_replica_count`,
* `max_replica_count`, `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and
* `enable_container_logging` (v1beta1 only).
* `max_replica_count`, `required_replica_count`, `autoscaling_metric_specs`,
* `disable_container_logging` (v1 only), and `enable_container_logging` (v1beta1 only).
*
* <p>Sample code:
*
Expand Down Expand Up @@ -1961,8 +1965,8 @@ public final UnaryCallable<UndeployModelRequest, Operation> undeployModelCallabl
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an existing deployed model. Updatable fields include `min_replica_count`,
* `max_replica_count`, `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and
* `enable_container_logging` (v1beta1 only).
* `max_replica_count`, `required_replica_count`, `autoscaling_metric_specs`,
* `disable_container_logging` (v1 only), and `enable_container_logging` (v1beta1 only).
*
* <p>Sample code:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,25 @@
* </td>
* </tr>
* <tr>
* <td><p> EmbedContent</td>
* <td><p> Embed content with multimodal inputs.</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li><p> embedContent(EmbedContentRequest request)
* </ul>
* <p>"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.</p>
* <ul>
* <li><p> embedContent(EndpointName model, Content content)
* <li><p> embedContent(String model, Content content)
* </ul>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li><p> embedContentCallable()
* </ul>
* </td>
* </tr>
* <tr>
* <td><p> ListLocations</td>
* <td><p> Lists information about the supported locations for this service.</td>
* <td>
Expand Down Expand Up @@ -559,6 +578,7 @@ public final PredictResponse predict(String endpoint, List<Value> instances, Val
* .toString())
* .addAllInstances(new ArrayList<Value>())
* .setParameters(Value.newBuilder().setBoolValue(true).build())
* .putAllLabels(new HashMap<String, String>())
* .build();
* PredictResponse response = predictionServiceClient.predict(request);
* }
Expand Down Expand Up @@ -592,6 +612,7 @@ public final PredictResponse predict(PredictRequest request) {
* .toString())
* .addAllInstances(new ArrayList<Value>())
* .setParameters(Value.newBuilder().setBoolValue(true).build())
* .putAllLabels(new HashMap<String, String>())
* .build();
* ApiFuture<PredictResponse> future =
* predictionServiceClient.predictCallable().futureCall(request);
Expand Down Expand Up @@ -1419,6 +1440,7 @@ public final GenerateContentResponse generateContent(String model, List<Content>
* .setToolConfig(ToolConfig.newBuilder().build())
* .putAllLabels(new HashMap<String, String>())
* .addAllSafetySettings(new ArrayList<SafetySetting>())
* .setModelArmorConfig(ModelArmorConfig.newBuilder().build())
* .setGenerationConfig(GenerationConfig.newBuilder().build())
* .build();
* GenerateContentResponse response = predictionServiceClient.generateContent(request);
Expand Down Expand Up @@ -1456,6 +1478,7 @@ public final GenerateContentResponse generateContent(GenerateContentRequest requ
* .setToolConfig(ToolConfig.newBuilder().build())
* .putAllLabels(new HashMap<String, String>())
* .addAllSafetySettings(new ArrayList<SafetySetting>())
* .setModelArmorConfig(ModelArmorConfig.newBuilder().build())
* .setGenerationConfig(GenerationConfig.newBuilder().build())
* .build();
* ApiFuture<GenerateContentResponse> future =
Expand Down Expand Up @@ -1494,6 +1517,7 @@ public final GenerateContentResponse generateContent(GenerateContentRequest requ
* .setToolConfig(ToolConfig.newBuilder().build())
* .putAllLabels(new HashMap<String, String>())
* .addAllSafetySettings(new ArrayList<SafetySetting>())
* .setModelArmorConfig(ModelArmorConfig.newBuilder().build())
* .setGenerationConfig(GenerationConfig.newBuilder().build())
* .build();
* ServerStream<GenerateContentResponse> stream =
Expand All @@ -1509,6 +1533,143 @@ public final GenerateContentResponse generateContent(GenerateContentRequest requ
return stub.streamGenerateContentCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Embed content with multimodal inputs.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
* EndpointName model =
* EndpointName.ofProjectLocationPublisherModelName(
* "[PROJECT]", "[LOCATION]", "[PUBLISHER]", "[MODEL]");
* Content content = Content.newBuilder().build();
* EmbedContentResponse response = predictionServiceClient.embedContent(model, content);
* }
* }</pre>
*
* @param model Required. The name of the publisher model requested to serve the prediction.
* Format: `projects/{project}/locations/{location}/publishers/&#42;/models/&#42;`
* @param content Required. Input content to be embedded. Required.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final EmbedContentResponse embedContent(EndpointName model, Content content) {
EmbedContentRequest request =
EmbedContentRequest.newBuilder()
.setModel(model == null ? null : model.toString())
.setContent(content)
.build();
return embedContent(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Embed content with multimodal inputs.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
* String model =
* EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString();
* Content content = Content.newBuilder().build();
* EmbedContentResponse response = predictionServiceClient.embedContent(model, content);
* }
* }</pre>
*
* @param model Required. The name of the publisher model requested to serve the prediction.
* Format: `projects/{project}/locations/{location}/publishers/&#42;/models/&#42;`
* @param content Required. Input content to be embedded. Required.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final EmbedContentResponse embedContent(String model, Content content) {
EmbedContentRequest request =
EmbedContentRequest.newBuilder().setModel(model).setContent(content).build();
return embedContent(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Embed content with multimodal inputs.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
* EmbedContentRequest request =
* EmbedContentRequest.newBuilder()
* .setModel(
* EndpointName.ofProjectLocationPublisherModelName(
* "[PROJECT]", "[LOCATION]", "[PUBLISHER]", "[MODEL]")
* .toString())
* .setContent(Content.newBuilder().build())
* .setTitle("title110371416")
* .setOutputDimensionality(-495931909)
* .setAutoTruncate(true)
* .build();
* EmbedContentResponse response = predictionServiceClient.embedContent(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final EmbedContentResponse embedContent(EmbedContentRequest request) {
return embedContentCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Embed content with multimodal inputs.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
* EmbedContentRequest request =
* EmbedContentRequest.newBuilder()
* .setModel(
* EndpointName.ofProjectLocationPublisherModelName(
* "[PROJECT]", "[LOCATION]", "[PUBLISHER]", "[MODEL]")
* .toString())
* .setContent(Content.newBuilder().build())
* .setTitle("title110371416")
* .setOutputDimensionality(-495931909)
* .setAutoTruncate(true)
* .build();
* ApiFuture<EmbedContentResponse> future =
* predictionServiceClient.embedContentCallable().futureCall(request);
* // Do something.
* EmbedContentResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<EmbedContentRequest, EmbedContentResponse> embedContentCallable() {
return stub.embedContentCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists information about the supported locations for this service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ public UnaryCallSettings<ExplainRequest, ExplainResponse> explainSettings() {
return ((PredictionServiceStubSettings) getStubSettings()).streamGenerateContentSettings();
}

/** Returns the object with the settings used for calls to embedContent. */
public UnaryCallSettings<EmbedContentRequest, EmbedContentResponse> embedContentSettings() {
return ((PredictionServiceStubSettings) getStubSettings()).embedContentSettings();
}

/** Returns the object with the settings used for calls to listLocations. */
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings() {
Expand Down Expand Up @@ -388,6 +393,12 @@ public UnaryCallSettings.Builder<ExplainRequest, ExplainResponse> explainSetting
return getStubSettingsBuilder().streamGenerateContentSettings();
}

/** Returns the builder for the settings used for calls to embedContent. */
public UnaryCallSettings.Builder<EmbedContentRequest, EmbedContentResponse>
embedContentSettings() {
return getStubSettingsBuilder().embedContentSettings();
}

/** Returns the builder for the settings used for calls to listLocations. */
public PagedCallSettings.Builder<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"DirectRawPredict": {
"methods": ["directRawPredict", "directRawPredictCallable"]
},
"EmbedContent": {
"methods": ["embedContent", "embedContent", "embedContent", "embedContentCallable"]
},
"Explain": {
"methods": ["explain", "explain", "explain", "explainCallable"]
},
Expand Down
Loading
Loading
0