|
60 | 60 | * EndpointName endpoint = |
61 | 61 | * EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); |
62 | 62 | * List<Value> instances = new ArrayList<>(); |
63 | | - * CountTokensResponse response = llmUtilityServiceClient.countTokens(endpoint, instances); |
| 63 | + * ComputeTokensResponse response = llmUtilityServiceClient.computeTokens(endpoint, instances); |
64 | 64 | * } |
65 | 65 | * }</pre> |
66 | 66 | * |
|
76 | 76 | * <th>Method Variants</th> |
77 | 77 | * </tr> |
78 | 78 | * <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<Value> instances) |
89 | | - * <li><p> countTokens(String endpoint, List<Value> 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> |
98 | 79 | * <td><p> ComputeTokens</td> |
99 | 80 | * <td><p> Return a list of tokens based on the input text.</td> |
100 | 81 | * <td> |
@@ -280,142 +261,6 @@ public LlmUtilityServiceStub getStub() { |
280 | 261 | return stub; |
281 | 262 | } |
282 | 263 |
|
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 | | - |
419 | 264 | // AUTO-GENERATED DOCUMENTATION AND METHOD. |
420 | 265 | /** |
421 | 266 | * Return a list of tokens based on the input text. |
|
0 commit comments