@Generated(value="by gapic-generator-java")
See: Description
The interfaces provided are listed below, along with usage samples.
======================= EndpointServiceClient =======================
Service Description: A service for managing Vertex AI's Endpoints.
Sample for EndpointServiceClient:
// 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 (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
EndpointName name =
EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
Endpoint response = endpointServiceClient.getEndpoint(name);
}
======================= LlmUtilityServiceClient =======================
Service Description: Service for LLM related utility functions.
Sample for LlmUtilityServiceClient:
// 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);
}
======================= PredictionServiceClient =======================
Service Description: A service for online predictions and explanations.
Sample for PredictionServiceClient:
// 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 endpoint =
EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
List<Value> instances = new ArrayList<>();
Value parameters = Value.newBuilder().setBoolValue(true).build();
PredictResponse response = predictionServiceClient.predict(endpoint, instances, parameters);
}
Copyright © 2024 Google LLC. All rights reserved.