Skip to content

Commit 0ee1383

Browse files
feat: [aiplatform] Add Grounding feature to PredictionService.GenerateContent (#10358)
* feat: Add Grounding feature to PredictionService.GenerateContent feat: Add Retrieval feat: Add GoogleSearchRetrieval feat: Add VertexAiSearch feat: Add Tool.retrieval feat: Add Tool.google_search_retrieval feat: Add Candidate.grounding_metadata docs: A comment for message `Tool` is changed docs: A comment for field `tools` in message `.google.cloud.aiplatform.v1beta1.GenerateContentRequest` is changed docs: A comment for field `tools` in message `.google.cloud.aiplatform.v1beta1.GenerateContentRequest` is changed PiperOrigin-RevId: 605743031 Source-Link: googleapis/googleapis@e183baf Source-Link: https://github.com/googleapis/googleapis-gen/commit/1f35985a865bce189bc3de39e0200681025ee213 Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiIxZjM1OTg1YTg2NWJjZTE4OWJjM2RlMzllMDIwMDY4MTAyNWVlMjEzIn0= fix!: remove field `max_wait_duration` from message Scheduling fix!: remove method `CountTokens` from service LlmUtilityService feat: add psc_automated_endpoints to IndexPrivateEndpoints feat: add update_mask to UpsertDatapointsRequest feat: add more RecordErrorType enum values feat: add request_response_logging_schema_version to ModelDeploymentMonitoringBigQueryTable feat: add resource_title, resource_use_case, resource_description to RegionalResourceReferences docs: deprecate use_case and description in ResourceReference feat: add deploy_gke, open_tine_tuning_pipelines, open_notebooks to CallToAction docs: minor changes to comments PiperOrigin-RevId: 605668103 Source-Link: googleapis/googleapis@f583398 Source-Link: https://github.com/googleapis/googleapis-gen/commit/74cf4058417bd2a6411395d286c34fb27088a76d Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiI3NGNmNDA1ODQxN2JkMmE2NDExMzk1ZDI4NmMzNGZiMjcwODhhNzZkIn0= fix!: remove field `max_wait_duration` from message Scheduling feat: add psc_automated_endpoints to IndexPrivateEndpoints feat: add request_response_logging_schema_version to ModelDeploymentMonitoringBigQueryTable feat: add resource_title, resource_use_case, resource_description to RegionalResourceReferences feat: add deploy_gke, open_tine_tuning_pipelines, open_notebooks to CallToAction docs: deprecate use_case and description in ResourceReference docs: minor changes to comments PiperOrigin-RevId: 605667976 Source-Link: googleapis/googleapis@3b25a48 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b8402de22611a3b7bffa59b075891e5b29a0d554 Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiJiODQwMmRlMjI2MTFhM2I3YmZmYTU5YjA3NTg5MWU1YjI5YTBkNTU0In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 15b3f90 commit 0ee1383

File tree

159 files changed

+34355
-7016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+34355
-7016
lines changed

java-aiplatform/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
195195
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
196196
[stability-image]: https://img.shields.io/badge/stability-stable-green
197197
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-aiplatform.svg
198-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-aiplatform/3.35.0
198+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-aiplatform/3.36.0
199199
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
200200
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
201201
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/FeatureOnlineStoreAdminServiceClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ public final ListFeatureOnlineStoresPagedResponse listFeatureOnlineStores(
10541054
* mask. If the user does not provide a mask then only the non-empty fields present in the
10551055
* request will be overwritten. Set the update_mask to `&#42;` to override all fields.
10561056
* <p>Updatable fields:
1057-
* <p>&#42; `big_query_source` &#42; `labels` &#42; `sync_config`
1057+
* <p>&#42; `big_query_source` &#42; `bigtable` &#42; `labels` &#42; `sync_config`
10581058
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
10591059
*/
10601060
public final OperationFuture<FeatureOnlineStore, UpdateFeatureOnlineStoreOperationMetadata>
@@ -1894,7 +1894,7 @@ public final ListFeatureViewsPagedResponse listFeatureViews(ListFeatureViewsRequ
18941894
* user does not provide a mask then only the non-empty fields present in the request will be
18951895
* overwritten. Set the update_mask to `&#42;` to override all fields.
18961896
* <p>Updatable fields:
1897-
* <p>&#42; `labels`
1897+
* <p>&#42; `labels` &#42; `serviceAgentType`
18981898
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
18991899
*/
19001900
public final OperationFuture<FeatureView, UpdateFeatureViewOperationMetadata>

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/IndexServiceClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,7 @@ public final UnaryCallable<DeleteIndexRequest, Operation> deleteIndexCallable()
10891089
* UpsertDatapointsRequest.newBuilder()
10901090
* .setIndex(IndexName.of("[PROJECT]", "[LOCATION]", "[INDEX]").toString())
10911091
* .addAllDatapoints(new ArrayList<IndexDatapoint>())
1092+
* .setUpdateMask(FieldMask.newBuilder().build())
10921093
* .build();
10931094
* UpsertDatapointsResponse response = indexServiceClient.upsertDatapoints(request);
10941095
* }
@@ -1118,6 +1119,7 @@ public final UpsertDatapointsResponse upsertDatapoints(UpsertDatapointsRequest r
11181119
* UpsertDatapointsRequest.newBuilder()
11191120
* .setIndex(IndexName.of("[PROJECT]", "[LOCATION]", "[INDEX]").toString())
11201121
* .addAllDatapoints(new ArrayList<IndexDatapoint>())
1122+
* .setUpdateMask(FieldMask.newBuilder().build())
11211123
* .build();
11221124
* ApiFuture<UpsertDatapointsResponse> future =
11231125
* indexServiceClient.upsertDatapointsCallable().futureCall(request);

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/FeatureOnlineStoreAdminServiceClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ public final ListFeatureOnlineStoresPagedResponse listFeatureOnlineStores(
10561056
* mask. If the user does not provide a mask then only the non-empty fields present in the
10571057
* request will be overwritten. Set the update_mask to `&#42;` to override all fields.
10581058
* <p>Updatable fields:
1059-
* <p>&#42; `big_query_source` &#42; `labels` &#42; `sync_config`
1059+
* <p>&#42; `big_query_source` &#42; `bigtable` &#42; `labels` &#42; `sync_config`
10601060
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
10611061
*/
10621062
public final OperationFuture<FeatureOnlineStore, UpdateFeatureOnlineStoreOperationMetadata>
@@ -1896,7 +1896,7 @@ public final ListFeatureViewsPagedResponse listFeatureViews(ListFeatureViewsRequ
18961896
* user does not provide a mask then only the non-empty fields present in the request will be
18971897
* overwritten. Set the update_mask to `&#42;` to override all fields.
18981898
* <p>Updatable fields:
1899-
* <p>&#42; `labels`
1899+
* <p>&#42; `labels` &#42; `serviceAgentType`
19001900
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
19011901
*/
19021902
public final OperationFuture<FeatureView, UpdateFeatureViewOperationMetadata>

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/IndexServiceClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,7 @@ public final UnaryCallable<DeleteIndexRequest, Operation> deleteIndexCallable()
10911091
* UpsertDatapointsRequest.newBuilder()
10921092
* .setIndex(IndexName.of("[PROJECT]", "[LOCATION]", "[INDEX]").toString())
10931093
* .addAllDatapoints(new ArrayList<IndexDatapoint>())
1094+
* .setUpdateMask(FieldMask.newBuilder().build())
10941095
* .build();
10951096
* UpsertDatapointsResponse response = indexServiceClient.upsertDatapoints(request);
10961097
* }
@@ -1120,6 +1121,7 @@ public final UpsertDatapointsResponse upsertDatapoints(UpsertDatapointsRequest r
11201121
* UpsertDatapointsRequest.newBuilder()
11211122
* .setIndex(IndexName.of("[PROJECT]", "[LOCATION]", "[INDEX]").toString())
11221123
* .addAllDatapoints(new ArrayList<IndexDatapoint>())
1124+
* .setUpdateMask(FieldMask.newBuilder().build())
11231125
* .build();
11241126
* ApiFuture<UpsertDatapointsResponse> future =
11251127
* indexServiceClient.upsertDatapointsCallable().futureCall(request);

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/LlmUtilityServiceClient.java

Lines changed: 1 addition & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
* EndpointName endpoint =
6161
* EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
6262
* List<Value> instances = new ArrayList<>();
63-
* CountTokensResponse response = llmUtilityServiceClient.countTokens(endpoint, instances);
63+
* ComputeTokensResponse response = llmUtilityServiceClient.computeTokens(endpoint, instances);
6464
* }
6565
* }</pre>
6666
*
@@ -76,25 +76,6 @@
7676
* <th>Method Variants</th>
7777
* </tr>
7878
* <tr>
79-
* <td><p> CountTokens</td>
80-
* <td><p> Perform a token counting.</td>
81-
* <td>
82-
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
83-
* <ul>
84-
* <li><p> countTokens(CountTokensRequest request)
85-
* </ul>
86-
* <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>
87-
* <ul>
88-
* <li><p> countTokens(EndpointName endpoint, List&lt;Value&gt; instances)
89-
* <li><p> countTokens(String endpoint, List&lt;Value&gt; instances)
90-
* </ul>
91-
* <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>
92-
* <ul>
93-
* <li><p> countTokensCallable()
94-
* </ul>
95-
* </td>
96-
* </tr>
97-
* <tr>
9879
* <td><p> ComputeTokens</td>
9980
* <td><p> Return a list of tokens based on the input text.</td>
10081
* <td>
@@ -280,142 +261,6 @@ public LlmUtilityServiceStub getStub() {
280261
return stub;
281262
}
282263

283-
// AUTO-GENERATED DOCUMENTATION AND METHOD.
284-
/**
285-
* Perform a token counting.
286-
*
287-
* <p>Sample code:
288-
*
289-
* <pre>{@code
290-
* // This snippet has been automatically generated and should be regarded as a code template only.
291-
* // It will require modifications to work:
292-
* // - It may require correct/in-range values for request initialization.
293-
* // - It may require specifying regional endpoints when creating the service client as shown in
294-
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
295-
* try (LlmUtilityServiceClient llmUtilityServiceClient = LlmUtilityServiceClient.create()) {
296-
* EndpointName endpoint =
297-
* EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
298-
* List<Value> instances = new ArrayList<>();
299-
* CountTokensResponse response = llmUtilityServiceClient.countTokens(endpoint, instances);
300-
* }
301-
* }</pre>
302-
*
303-
* @param endpoint Required. The name of the Endpoint requested to perform token counting. Format:
304-
* `projects/{project}/locations/{location}/endpoints/{endpoint}`
305-
* @param instances Required. The instances that are the input to token counting call. Schema is
306-
* identical to the prediction schema of the underlying model.
307-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
308-
*/
309-
public final CountTokensResponse countTokens(EndpointName endpoint, List<Value> instances) {
310-
CountTokensRequest request =
311-
CountTokensRequest.newBuilder()
312-
.setEndpoint(endpoint == null ? null : endpoint.toString())
313-
.addAllInstances(instances)
314-
.build();
315-
return countTokens(request);
316-
}
317-
318-
// AUTO-GENERATED DOCUMENTATION AND METHOD.
319-
/**
320-
* Perform a token counting.
321-
*
322-
* <p>Sample code:
323-
*
324-
* <pre>{@code
325-
* // This snippet has been automatically generated and should be regarded as a code template only.
326-
* // It will require modifications to work:
327-
* // - It may require correct/in-range values for request initialization.
328-
* // - It may require specifying regional endpoints when creating the service client as shown in
329-
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
330-
* try (LlmUtilityServiceClient llmUtilityServiceClient = LlmUtilityServiceClient.create()) {
331-
* String endpoint =
332-
* EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
333-
* .toString();
334-
* List<Value> instances = new ArrayList<>();
335-
* CountTokensResponse response = llmUtilityServiceClient.countTokens(endpoint, instances);
336-
* }
337-
* }</pre>
338-
*
339-
* @param endpoint Required. The name of the Endpoint requested to perform token counting. Format:
340-
* `projects/{project}/locations/{location}/endpoints/{endpoint}`
341-
* @param instances Required. The instances that are the input to token counting call. Schema is
342-
* identical to the prediction schema of the underlying model.
343-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
344-
*/
345-
public final CountTokensResponse countTokens(String endpoint, List<Value> instances) {
346-
CountTokensRequest request =
347-
CountTokensRequest.newBuilder().setEndpoint(endpoint).addAllInstances(instances).build();
348-
return countTokens(request);
349-
}
350-
351-
// AUTO-GENERATED DOCUMENTATION AND METHOD.
352-
/**
353-
* Perform a token counting.
354-
*
355-
* <p>Sample code:
356-
*
357-
* <pre>{@code
358-
* // This snippet has been automatically generated and should be regarded as a code template only.
359-
* // It will require modifications to work:
360-
* // - It may require correct/in-range values for request initialization.
361-
* // - It may require specifying regional endpoints when creating the service client as shown in
362-
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
363-
* try (LlmUtilityServiceClient llmUtilityServiceClient = LlmUtilityServiceClient.create()) {
364-
* CountTokensRequest request =
365-
* CountTokensRequest.newBuilder()
366-
* .setEndpoint(
367-
* EndpointName.ofProjectLocationEndpointName(
368-
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
369-
* .toString())
370-
* .setModel("model104069929")
371-
* .addAllInstances(new ArrayList<Value>())
372-
* .addAllContents(new ArrayList<Content>())
373-
* .build();
374-
* CountTokensResponse response = llmUtilityServiceClient.countTokens(request);
375-
* }
376-
* }</pre>
377-
*
378-
* @param request The request object containing all of the parameters for the API call.
379-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
380-
*/
381-
public final CountTokensResponse countTokens(CountTokensRequest request) {
382-
return countTokensCallable().call(request);
383-
}
384-
385-
// AUTO-GENERATED DOCUMENTATION AND METHOD.
386-
/**
387-
* Perform a token counting.
388-
*
389-
* <p>Sample code:
390-
*
391-
* <pre>{@code
392-
* // This snippet has been automatically generated and should be regarded as a code template only.
393-
* // It will require modifications to work:
394-
* // - It may require correct/in-range values for request initialization.
395-
* // - It may require specifying regional endpoints when creating the service client as shown in
396-
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
397-
* try (LlmUtilityServiceClient llmUtilityServiceClient = LlmUtilityServiceClient.create()) {
398-
* CountTokensRequest request =
399-
* CountTokensRequest.newBuilder()
400-
* .setEndpoint(
401-
* EndpointName.ofProjectLocationEndpointName(
402-
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
403-
* .toString())
404-
* .setModel("model104069929")
405-
* .addAllInstances(new ArrayList<Value>())
406-
* .addAllContents(new ArrayList<Content>())
407-
* .build();
408-
* ApiFuture<CountTokensResponse> future =
409-
* llmUtilityServiceClient.countTokensCallable().futureCall(request);
410-
* // Do something.
411-
* CountTokensResponse response = future.get();
412-
* }
413-
* }</pre>
414-
*/
415-
public final UnaryCallable<CountTokensRequest, CountTokensResponse> countTokensCallable() {
416-
return stub.countTokensCallable();
417-
}
418-
419264
// AUTO-GENERATED DOCUMENTATION AND METHOD.
420265
/**
421266
* Return a list of tokens based on the input text.

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/LlmUtilityServiceSettings.java

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
5959
* build() is called, the tree of builders is called to create the complete settings object.
6060
*
61-
* <p>For example, to set the total timeout of countTokens to 30 seconds:
61+
* <p>For example, to set the total timeout of computeTokens to 30 seconds:
6262
*
6363
* <pre>{@code
6464
* // This snippet has been automatically generated and should be regarded as a code template only.
@@ -69,10 +69,10 @@
6969
* LlmUtilityServiceSettings.Builder llmUtilityServiceSettingsBuilder =
7070
* LlmUtilityServiceSettings.newBuilder();
7171
* llmUtilityServiceSettingsBuilder
72-
* .countTokensSettings()
72+
* .computeTokensSettings()
7373
* .setRetrySettings(
7474
* llmUtilityServiceSettingsBuilder
75-
* .countTokensSettings()
75+
* .computeTokensSettings()
7676
* .getRetrySettings()
7777
* .toBuilder()
7878
* .setTotalTimeout(Duration.ofSeconds(30))
@@ -84,11 +84,6 @@
8484
@Generated("by gapic-generator-java")
8585
public class LlmUtilityServiceSettings extends ClientSettings<LlmUtilityServiceSettings> {
8686

87-
/** Returns the object with the settings used for calls to countTokens. */
88-
public UnaryCallSettings<CountTokensRequest, CountTokensResponse> countTokensSettings() {
89-
return ((LlmUtilityServiceStubSettings) getStubSettings()).countTokensSettings();
90-
}
91-
9287
/** Returns the object with the settings used for calls to computeTokens. */
9388
public UnaryCallSettings<ComputeTokensRequest, ComputeTokensResponse> computeTokensSettings() {
9489
return ((LlmUtilityServiceStubSettings) getStubSettings()).computeTokensSettings();
@@ -218,12 +213,6 @@ public Builder applyToAllUnaryMethods(
218213
return this;
219214
}
220215

221-
/** Returns the builder for the settings used for calls to countTokens. */
222-
public UnaryCallSettings.Builder<CountTokensRequest, CountTokensResponse>
223-
countTokensSettings() {
224-
return getStubSettingsBuilder().countTokensSettings();
225-
}
226-
227216
/** Returns the builder for the settings used for calls to computeTokens. */
228217
public UnaryCallSettings.Builder<ComputeTokensRequest, ComputeTokensResponse>
229218
computeTokensSettings() {

0 commit comments

Comments
 (0)