Skip to content

Commit

Permalink
Merge branch 'main' into new-library/meet-GTlDt
Browse files Browse the repository at this point in the history
  • Loading branch information
suztomo authored Jan 19, 2024
2 parents 3e52d7b + 01c1542 commit c0ecba6
Show file tree
Hide file tree
Showing 346 changed files with 26,513 additions and 6,646 deletions.
8 changes: 4 additions & 4 deletions google-cloud-jar-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub-bom</artifactId>
<version>1.125.12</version>
<version>1.126.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -61,12 +61,12 @@
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-cloudresourcemanager</artifactId>
<version>v1-rev20231022-2.0.0</version>
<version>v1-rev20240109-2.0.0</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-storage</artifactId>
<version>v1-rev20231117-2.0.0</version>
<version>v1-rev20240105-2.0.0</version>
</dependency>

<!-- Test dependencies -->
Expand All @@ -79,7 +79,7 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.12.5</version>
<version>2.12.6</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion java-accessapproval/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.29.0</version>
<version>26.30.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion java-accesscontextmanager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.29.0</version>
<version>26.30.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion java-advisorynotifications/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.29.0</version>
<version>26.30.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions java-aiplatform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.29.0</version>
<version>26.30.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-aiplatform.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-aiplatform/3.33.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-aiplatform/3.34.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ public final OperationsClient getOperationsClient() {
* }</pre>
*
* @param parent Required. The resource name of the Location to create FeatureOnlineStores.
* Format: `projects/{project}/locations/{location}'`
* Format: `projects/{project}/locations/{location}`
* @param featureOnlineStore Required. The FeatureOnlineStore to create.
* @param featureOnlineStoreId Required. The ID to use for this FeatureOnlineStore, which will
* become the final component of the FeatureOnlineStore's resource name.
Expand Down Expand Up @@ -586,7 +586,7 @@ public final OperationsClient getOperationsClient() {
* }</pre>
*
* @param parent Required. The resource name of the Location to create FeatureOnlineStores.
* Format: `projects/{project}/locations/{location}'`
* Format: `projects/{project}/locations/{location}`
* @param featureOnlineStore Required. The FeatureOnlineStore to create.
* @param featureOnlineStoreId Required. The ID to use for this FeatureOnlineStore, which will
* become the final component of the FeatureOnlineStore's resource name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ public final OperationsClient getOperationsClient() {
* }</pre>
*
* @param parent Required. The resource name of the Location to create FeatureOnlineStores.
* Format: `projects/{project}/locations/{location}'`
* Format: `projects/{project}/locations/{location}`
* @param featureOnlineStore Required. The FeatureOnlineStore to create.
* @param featureOnlineStoreId Required. The ID to use for this FeatureOnlineStore, which will
* become the final component of the FeatureOnlineStore's resource name.
Expand Down Expand Up @@ -588,7 +588,7 @@ public final OperationsClient getOperationsClient() {
* }</pre>
*
* @param parent Required. The resource name of the Location to create FeatureOnlineStores.
* Format: `projects/{project}/locations/{location}'`
* Format: `projects/{project}/locations/{location}`
* @param featureOnlineStore Required. The FeatureOnlineStore to create.
* @param featureOnlineStoreId Required. The ID to use for this FeatureOnlineStore, which will
* become the final component of the FeatureOnlineStore's resource name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
* EndpointName endpoint =
* EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
* List<Value> instances = new ArrayList<>();
* ComputeTokensResponse response = llmUtilityServiceClient.computeTokens(endpoint, instances);
* CountTokensResponse response = llmUtilityServiceClient.countTokens(endpoint, instances);
* }
* }</pre>
*
Expand All @@ -74,6 +74,25 @@
* <th>Description</th>
* <th>Method Variants</th>
* <tr>
* <td>CountTokens</td>
* <td><p> Perform a token counting.</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li>countTokens(CountTokensRequest 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>countTokens(EndpointName endpoint, List<Value> instances)
* <li>countTokens(String endpoint, List<Value> instances)
* </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>countTokensCallable()
* </ul>
* </td>
* </tr>
* <tr>
* <td>ComputeTokens</td>
* <td><p> Return a list of tokens based on the input text.</td>
* <td>
Expand Down Expand Up @@ -260,6 +279,142 @@ public LlmUtilityServiceStub getStub() {
return stub;
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform a token counting.
*
* <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 (LlmUtilityServiceClient llmUtilityServiceClient = LlmUtilityServiceClient.create()) {
* EndpointName endpoint =
* EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
* List<Value> instances = new ArrayList<>();
* CountTokensResponse response = llmUtilityServiceClient.countTokens(endpoint, instances);
* }
* }</pre>
*
* @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
* identical to the prediction schema of the underlying model.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final CountTokensResponse countTokens(EndpointName endpoint, List<Value> instances) {
CountTokensRequest request =
CountTokensRequest.newBuilder()
.setEndpoint(endpoint == null ? null : endpoint.toString())
.addAllInstances(instances)
.build();
return countTokens(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform a token counting.
*
* <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 (LlmUtilityServiceClient llmUtilityServiceClient = LlmUtilityServiceClient.create()) {
* String endpoint =
* EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString();
* List<Value> instances = new ArrayList<>();
* CountTokensResponse response = llmUtilityServiceClient.countTokens(endpoint, instances);
* }
* }</pre>
*
* @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
* identical to the prediction schema of the underlying model.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final CountTokensResponse countTokens(String endpoint, List<Value> instances) {
CountTokensRequest request =
CountTokensRequest.newBuilder().setEndpoint(endpoint).addAllInstances(instances).build();
return countTokens(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform a token counting.
*
* <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 (LlmUtilityServiceClient llmUtilityServiceClient = LlmUtilityServiceClient.create()) {
* CountTokensRequest request =
* CountTokensRequest.newBuilder()
* .setEndpoint(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .setModel("model104069929")
* .addAllInstances(new ArrayList<Value>())
* .addAllContents(new ArrayList<Content>())
* .build();
* CountTokensResponse response = llmUtilityServiceClient.countTokens(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 CountTokensResponse countTokens(CountTokensRequest request) {
return countTokensCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform a token counting.
*
* <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 (LlmUtilityServiceClient llmUtilityServiceClient = LlmUtilityServiceClient.create()) {
* CountTokensRequest request =
* CountTokensRequest.newBuilder()
* .setEndpoint(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .setModel("model104069929")
* .addAllInstances(new ArrayList<Value>())
* .addAllContents(new ArrayList<Content>())
* .build();
* ApiFuture<CountTokensResponse> future =
* llmUtilityServiceClient.countTokensCallable().futureCall(request);
* // Do something.
* CountTokensResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<CountTokensRequest, CountTokensResponse> countTokensCallable() {
return stub.countTokensCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Return a list of tokens based on the input text.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
* <p>For example, to set the total timeout of computeTokens to 30 seconds:
* <p>For example, to set the total timeout of countTokens to 30 seconds:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
Expand All @@ -69,10 +69,10 @@
* LlmUtilityServiceSettings.Builder llmUtilityServiceSettingsBuilder =
* LlmUtilityServiceSettings.newBuilder();
* llmUtilityServiceSettingsBuilder
* .computeTokensSettings()
* .countTokensSettings()
* .setRetrySettings(
* llmUtilityServiceSettingsBuilder
* .computeTokensSettings()
* .countTokensSettings()
* .getRetrySettings()
* .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
Expand All @@ -84,6 +84,11 @@
@Generated("by gapic-generator-java")
public class LlmUtilityServiceSettings extends ClientSettings<LlmUtilityServiceSettings> {

/** Returns the object with the settings used for calls to countTokens. */
public UnaryCallSettings<CountTokensRequest, CountTokensResponse> countTokensSettings() {
return ((LlmUtilityServiceStubSettings) getStubSettings()).countTokensSettings();
}

/** Returns the object with the settings used for calls to computeTokens. */
public UnaryCallSettings<ComputeTokensRequest, ComputeTokensResponse> computeTokensSettings() {
return ((LlmUtilityServiceStubSettings) getStubSettings()).computeTokensSettings();
Expand Down Expand Up @@ -213,6 +218,12 @@ public Builder applyToAllUnaryMethods(
return this;
}

/** Returns the builder for the settings used for calls to countTokens. */
public UnaryCallSettings.Builder<CountTokensRequest, CountTokensResponse>
countTokensSettings() {
return getStubSettingsBuilder().countTokensSettings();
}

/** Returns the builder for the settings used for calls to computeTokens. */
public UnaryCallSettings.Builder<ComputeTokensRequest, ComputeTokensResponse>
computeTokensSettings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,9 @@
"ComputeTokens": {
"methods": ["computeTokens", "computeTokens", "computeTokens", "computeTokensCallable"]
},
"CountTokens": {
"methods": ["countTokens", "countTokens", "countTokens", "countTokensCallable"]
},
"GetIamPolicy": {
"methods": ["getIamPolicy", "getIamPolicyCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
* EndpointName endpoint =
* EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
* List<Value> instances = new ArrayList<>();
* ComputeTokensResponse response = llmUtilityServiceClient.computeTokens(endpoint, instances);
* CountTokensResponse response = llmUtilityServiceClient.countTokens(endpoint, instances);
* }
* }</pre>
*
Expand Down
Loading

0 comments on commit c0ecba6

Please sign in to comment.