Class ConversationModelsClient (4.7.5)

public class ConversationModelsClient implements BackgroundResource

Service Description: Manages a collection of models for human agent assistant.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   String name = "name3373707";
   ConversationModel response = conversationModelsClient.getConversationModel(name);
 }
 

Note: close() needs to be called on the ConversationModelsClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of ConversationModelsSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 ConversationModelsSettings conversationModelsSettings =
     ConversationModelsSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ConversationModelsClient conversationModelsClient =
     ConversationModelsClient.create(conversationModelsSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 ConversationModelsSettings conversationModelsSettings =
     ConversationModelsSettings.newBuilder().setEndpoint(myEndpoint).build();
 ConversationModelsClient conversationModelsClient =
     ConversationModelsClient.create(conversationModelsSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 ConversationModelsSettings conversationModelsSettings =
     ConversationModelsSettings.newBuilder()
         .setTransportChannelProvider(
             ConversationModelsSettings.defaultHttpJsonTransportProviderBuilder().build())
         .build();
 ConversationModelsClient conversationModelsClient =
     ConversationModelsClient.create(conversationModelsSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > ConversationModelsClient

Implements

BackgroundResource

Static Methods

create()

public static final ConversationModelsClient create()

Constructs an instance of ConversationModelsClient with default settings.

Returns
TypeDescription
ConversationModelsClient
Exceptions
TypeDescription
IOException

create(ConversationModelsSettings settings)

public static final ConversationModelsClient create(ConversationModelsSettings settings)

Constructs an instance of ConversationModelsClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
NameDescription
settingsConversationModelsSettings
Returns
TypeDescription
ConversationModelsClient
Exceptions
TypeDescription
IOException

create(ConversationModelsStub stub)

public static final ConversationModelsClient create(ConversationModelsStub stub)

Constructs an instance of ConversationModelsClient, using the given stub for making calls. This is for advanced usage - prefer using create(ConversationModelsSettings).

Parameter
NameDescription
stubConversationModelsStub
Returns
TypeDescription
ConversationModelsClient

Constructors

ConversationModelsClient(ConversationModelsSettings settings)

protected ConversationModelsClient(ConversationModelsSettings settings)

Constructs an instance of ConversationModelsClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
NameDescription
settingsConversationModelsSettings

ConversationModelsClient(ConversationModelsStub stub)

protected ConversationModelsClient(ConversationModelsStub stub)
Parameter
NameDescription
stubConversationModelsStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

public final void close()

createConversationModelAsync(CreateConversationModelRequest request)

public final OperationFuture<ConversationModel,CreateConversationModelOperationMetadata> createConversationModelAsync(CreateConversationModelRequest request)

Creates a model.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: CreateConversationModelOperationMetadata

  • response: ConversationModel

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    CreateConversationModelRequest request =
        CreateConversationModelRequest.newBuilder()
            .setParent("parent-995424086")
            .setConversationModel(ConversationModel.newBuilder().build())
            .build();
    ConversationModel response =
        conversationModelsClient.createConversationModelAsync(request).get();
    }
    
Parameter
NameDescription
requestCreateConversationModelRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<ConversationModel,CreateConversationModelOperationMetadata>

createConversationModelAsync(String parent, ConversationModel conversationModel)

public final OperationFuture<ConversationModel,CreateConversationModelOperationMetadata> createConversationModelAsync(String parent, ConversationModel conversationModel)

Creates a model.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: CreateConversationModelOperationMetadata

  • response: ConversationModel

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    String parent = "parent-995424086";
    ConversationModel conversationModel = ConversationModel.newBuilder().build();
    ConversationModel response =
        conversationModelsClient.createConversationModelAsync(parent, conversationModel).get();
    }
    
Parameters
NameDescription
parentString

The project to create conversation model for. Format: projects/<Project ID>

conversationModelConversationModel

Required. The conversation model to create.

Returns
TypeDescription
OperationFuture<ConversationModel,CreateConversationModelOperationMetadata>

createConversationModelCallable()

public final UnaryCallable<CreateConversationModelRequest,Operation> createConversationModelCallable()

Creates a model.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: CreateConversationModelOperationMetadata

  • response: ConversationModel

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    CreateConversationModelRequest request =
        CreateConversationModelRequest.newBuilder()
            .setParent("parent-995424086")
            .setConversationModel(ConversationModel.newBuilder().build())
            .build();
    ApiFuture<Operation> future =
        conversationModelsClient.createConversationModelCallable().futureCall(request);
    // Do something.
    Operation response = future.get();
    }
    
Returns
TypeDescription
UnaryCallable<CreateConversationModelRequest,Operation>

createConversationModelEvaluationAsync(ConversationModelName parent, ConversationModelEvaluation conversationModelEvaluation)

public final OperationFuture<ConversationModelEvaluation,CreateConversationModelEvaluationOperationMetadata> createConversationModelEvaluationAsync(ConversationModelName parent, ConversationModelEvaluation conversationModelEvaluation)

Creates evaluation of a conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   ConversationModelName parent =
       ConversationModelName.ofProjectLocationConversationModelName(
           "[PROJECT]", "[LOCATION]", "[CONVERSATION_MODEL]");
   ConversationModelEvaluation conversationModelEvaluation =
       ConversationModelEvaluation.newBuilder().build();
   ConversationModelEvaluation response =
       conversationModelsClient
           .createConversationModelEvaluationAsync(parent, conversationModelEvaluation)
           .get();
 }
 
Parameters
NameDescription
parentConversationModelName

Required. The conversation model resource name. Format: projects/<Project ID>/locations/<Location ID>/conversationModels/<Conversation Model ID>

conversationModelEvaluationConversationModelEvaluation

Required. The conversation model evaluation to be created.

Returns
TypeDescription
OperationFuture<ConversationModelEvaluation,CreateConversationModelEvaluationOperationMetadata>

createConversationModelEvaluationAsync(CreateConversationModelEvaluationRequest request)

public final OperationFuture<ConversationModelEvaluation,CreateConversationModelEvaluationOperationMetadata> createConversationModelEvaluationAsync(CreateConversationModelEvaluationRequest request)

Creates evaluation of a conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   CreateConversationModelEvaluationRequest request =
       CreateConversationModelEvaluationRequest.newBuilder()
           .setParent(
               ConversationModelName.ofProjectLocationConversationModelName(
                       "[PROJECT]", "[LOCATION]", "[CONVERSATION_MODEL]")
                   .toString())
           .setConversationModelEvaluation(ConversationModelEvaluation.newBuilder().build())
           .build();
   ConversationModelEvaluation response =
       conversationModelsClient.createConversationModelEvaluationAsync(request).get();
 }
 
Parameter
NameDescription
requestCreateConversationModelEvaluationRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<ConversationModelEvaluation,CreateConversationModelEvaluationOperationMetadata>

createConversationModelEvaluationAsync(String parent, ConversationModelEvaluation conversationModelEvaluation)

public final OperationFuture<ConversationModelEvaluation,CreateConversationModelEvaluationOperationMetadata> createConversationModelEvaluationAsync(String parent, ConversationModelEvaluation conversationModelEvaluation)

Creates evaluation of a conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   String parent =
       ConversationModelName.ofProjectLocationConversationModelName(
               "[PROJECT]", "[LOCATION]", "[CONVERSATION_MODEL]")
           .toString();
   ConversationModelEvaluation conversationModelEvaluation =
       ConversationModelEvaluation.newBuilder().build();
   ConversationModelEvaluation response =
       conversationModelsClient
           .createConversationModelEvaluationAsync(parent, conversationModelEvaluation)
           .get();
 }
 
Parameters
NameDescription
parentString

Required. The conversation model resource name. Format: projects/<Project ID>/locations/<Location ID>/conversationModels/<Conversation Model ID>

conversationModelEvaluationConversationModelEvaluation

Required. The conversation model evaluation to be created.

Returns
TypeDescription
OperationFuture<ConversationModelEvaluation,CreateConversationModelEvaluationOperationMetadata>

createConversationModelEvaluationCallable()

public final UnaryCallable<CreateConversationModelEvaluationRequest,Operation> createConversationModelEvaluationCallable()

Creates evaluation of a conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   CreateConversationModelEvaluationRequest request =
       CreateConversationModelEvaluationRequest.newBuilder()
           .setParent(
               ConversationModelName.ofProjectLocationConversationModelName(
                       "[PROJECT]", "[LOCATION]", "[CONVERSATION_MODEL]")
                   .toString())
           .setConversationModelEvaluation(ConversationModelEvaluation.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       conversationModelsClient.createConversationModelEvaluationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateConversationModelEvaluationRequest,Operation>

createConversationModelEvaluationOperationCallable()

public final OperationCallable<CreateConversationModelEvaluationRequest,ConversationModelEvaluation,CreateConversationModelEvaluationOperationMetadata> createConversationModelEvaluationOperationCallable()

Creates evaluation of a conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   CreateConversationModelEvaluationRequest request =
       CreateConversationModelEvaluationRequest.newBuilder()
           .setParent(
               ConversationModelName.ofProjectLocationConversationModelName(
                       "[PROJECT]", "[LOCATION]", "[CONVERSATION_MODEL]")
                   .toString())
           .setConversationModelEvaluation(ConversationModelEvaluation.newBuilder().build())
           .build();
   OperationFuture< conversationmodelevaluation,="" createconversationmodelevaluationoperationmetadata="">
       future =
           conversationModelsClient
               .createConversationModelEvaluationOperationCallable()
               .futureCall(request);
   // Do something.
   ConversationModelEvaluation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<CreateConversationModelEvaluationRequest,ConversationModelEvaluation,CreateConversationModelEvaluationOperationMetadata>

createConversationModelOperationCallable()

public final OperationCallable<CreateConversationModelRequest,ConversationModel,CreateConversationModelOperationMetadata> createConversationModelOperationCallable()

Creates a model.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: CreateConversationModelOperationMetadata

  • response: ConversationModel

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    CreateConversationModelRequest request =
        CreateConversationModelRequest.newBuilder()
            .setParent("parent-995424086")
            .setConversationModel(ConversationModel.newBuilder().build())
            .build();
    OperationFuture<ConversationModel, CreateConversationModelOperationMetadata> future =
        conversationModelsClient.createConversationModelOperationCallable().futureCall(request);
    // Do something.
    ConversationModel response = future.get();
    }
    
Returns
TypeDescription
OperationCallable<CreateConversationModelRequest,ConversationModel,CreateConversationModelOperationMetadata>

deleteConversationModelAsync(DeleteConversationModelRequest request)

public final OperationFuture<Empty,DeleteConversationModelOperationMetadata> deleteConversationModelAsync(DeleteConversationModelRequest request)

Deletes a model.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: DeleteConversationModelOperationMetadata

  • response: An Empty message

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    DeleteConversationModelRequest request =
        DeleteConversationModelRequest.newBuilder().setName("name3373707").build();
    conversationModelsClient.deleteConversationModelAsync(request).get();
    }
    
Parameter
NameDescription
requestDeleteConversationModelRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Empty,DeleteConversationModelOperationMetadata>

deleteConversationModelAsync(String name)

public final OperationFuture<Empty,DeleteConversationModelOperationMetadata> deleteConversationModelAsync(String name)

Deletes a model.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: DeleteConversationModelOperationMetadata

  • response: An Empty message

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    String name = "name3373707";
    conversationModelsClient.deleteConversationModelAsync(name).get();
    }
    
Parameter
NameDescription
nameString

Required. The conversation model to delete. Format: projects/<Project ID>/conversationModels/<Conversation Model ID>

Returns
TypeDescription
OperationFuture<Empty,DeleteConversationModelOperationMetadata>

deleteConversationModelCallable()

public final UnaryCallable<DeleteConversationModelRequest,Operation> deleteConversationModelCallable()

Deletes a model.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: DeleteConversationModelOperationMetadata

  • response: An Empty message

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    DeleteConversationModelRequest request =
        DeleteConversationModelRequest.newBuilder().setName("name3373707").build();
    ApiFuture<Operation> future =
        conversationModelsClient.deleteConversationModelCallable().futureCall(request);
    // Do something.
    future.get();
    }
    
Returns
TypeDescription
UnaryCallable<DeleteConversationModelRequest,Operation>

deleteConversationModelOperationCallable()

public final OperationCallable<DeleteConversationModelRequest,Empty,DeleteConversationModelOperationMetadata> deleteConversationModelOperationCallable()

Deletes a model.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: DeleteConversationModelOperationMetadata

  • response: An Empty message

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    DeleteConversationModelRequest request =
        DeleteConversationModelRequest.newBuilder().setName("name3373707").build();
    OperationFuture<Empty, DeleteConversationModelOperationMetadata> future =
        conversationModelsClient.deleteConversationModelOperationCallable().futureCall(request);
    // Do something.
    future.get();
    }
    
Returns
TypeDescription
OperationCallable<DeleteConversationModelRequest,Empty,DeleteConversationModelOperationMetadata>

deployConversationModelAsync(DeployConversationModelRequest request)

public final OperationFuture<Empty,DeployConversationModelOperationMetadata> deployConversationModelAsync(DeployConversationModelRequest request)

Deploys a model. If a model is already deployed, deploying it has no effect. A model can only serve prediction requests after it gets deployed. For article suggestion, custom model will not be used unless it is deployed.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: DeployConversationModelOperationMetadata

  • response: An Empty message

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    DeployConversationModelRequest request =
        DeployConversationModelRequest.newBuilder().setName("name3373707").build();
    conversationModelsClient.deployConversationModelAsync(request).get();
    }
    
Parameter
NameDescription
requestDeployConversationModelRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Empty,DeployConversationModelOperationMetadata>

deployConversationModelCallable()

public final UnaryCallable<DeployConversationModelRequest,Operation> deployConversationModelCallable()

Deploys a model. If a model is already deployed, deploying it has no effect. A model can only serve prediction requests after it gets deployed. For article suggestion, custom model will not be used unless it is deployed.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: DeployConversationModelOperationMetadata

  • response: An Empty message

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    DeployConversationModelRequest request =
        DeployConversationModelRequest.newBuilder().setName("name3373707").build();
    ApiFuture<Operation> future =
        conversationModelsClient.deployConversationModelCallable().futureCall(request);
    // Do something.
    future.get();
    }
    
Returns
TypeDescription
UnaryCallable<DeployConversationModelRequest,Operation>

deployConversationModelOperationCallable()

public final OperationCallable<DeployConversationModelRequest,Empty,DeployConversationModelOperationMetadata> deployConversationModelOperationCallable()

Deploys a model. If a model is already deployed, deploying it has no effect. A model can only serve prediction requests after it gets deployed. For article suggestion, custom model will not be used unless it is deployed.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: DeployConversationModelOperationMetadata

  • response: An Empty message

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    DeployConversationModelRequest request =
        DeployConversationModelRequest.newBuilder().setName("name3373707").build();
    OperationFuture<Empty, DeployConversationModelOperationMetadata> future =
        conversationModelsClient.deployConversationModelOperationCallable().futureCall(request);
    // Do something.
    future.get();
    }
    
Returns
TypeDescription
OperationCallable<DeployConversationModelRequest,Empty,DeployConversationModelOperationMetadata>

getConversationModel(GetConversationModelRequest request)

public final ConversationModel getConversationModel(GetConversationModelRequest request)

Gets conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   GetConversationModelRequest request =
       GetConversationModelRequest.newBuilder().setName("name3373707").build();
   ConversationModel response = conversationModelsClient.getConversationModel(request);
 }
 
Parameter
NameDescription
requestGetConversationModelRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ConversationModel

getConversationModel(String name)

public final ConversationModel getConversationModel(String name)

Gets conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   String name = "name3373707";
   ConversationModel response = conversationModelsClient.getConversationModel(name);
 }
 
Parameter
NameDescription
nameString

Required. The conversation model to retrieve. Format: projects/<Project ID>/conversationModels/<Conversation Model ID>

Returns
TypeDescription
ConversationModel

getConversationModelCallable()

public final UnaryCallable<GetConversationModelRequest,ConversationModel> getConversationModelCallable()

Gets conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   GetConversationModelRequest request =
       GetConversationModelRequest.newBuilder().setName("name3373707").build();
   ApiFuture<ConversationModel> future =
       conversationModelsClient.getConversationModelCallable().futureCall(request);
   // Do something.
   ConversationModel response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetConversationModelRequest,ConversationModel>

getConversationModelEvaluation(GetConversationModelEvaluationRequest request)

public final ConversationModelEvaluation getConversationModelEvaluation(GetConversationModelEvaluationRequest request)

Gets an evaluation of conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   GetConversationModelEvaluationRequest request =
       GetConversationModelEvaluationRequest.newBuilder().setName("name3373707").build();
   ConversationModelEvaluation response =
       conversationModelsClient.getConversationModelEvaluation(request);
 }
 
Parameter
NameDescription
requestGetConversationModelEvaluationRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ConversationModelEvaluation

getConversationModelEvaluation(String name)

public final ConversationModelEvaluation getConversationModelEvaluation(String name)

Gets an evaluation of conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   String name = "name3373707";
   ConversationModelEvaluation response =
       conversationModelsClient.getConversationModelEvaluation(name);
 }
 
Parameter
NameDescription
nameString

Required. The conversation model evaluation resource name. Format: projects/<Project ID>/conversationModels/<Conversation Model ID>/evaluations/<Evaluation ID>

Returns
TypeDescription
ConversationModelEvaluation

getConversationModelEvaluationCallable()

public final UnaryCallable<GetConversationModelEvaluationRequest,ConversationModelEvaluation> getConversationModelEvaluationCallable()

Gets an evaluation of conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   GetConversationModelEvaluationRequest request =
       GetConversationModelEvaluationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<ConversationModelEvaluation> future =
       conversationModelsClient.getConversationModelEvaluationCallable().futureCall(request);
   // Do something.
   ConversationModelEvaluation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetConversationModelEvaluationRequest,ConversationModelEvaluation>

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getOperationsClient()

public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getSettings()

public final ConversationModelsSettings getSettings()
Returns
TypeDescription
ConversationModelsSettings

getStub()

public ConversationModelsStub getStub()
Returns
TypeDescription
ConversationModelsStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listConversationModelEvaluations(ListConversationModelEvaluationsRequest request)

public final ConversationModelsClient.ListConversationModelEvaluationsPagedResponse listConversationModelEvaluations(ListConversationModelEvaluationsRequest request)

Lists evaluations of a conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   ListConversationModelEvaluationsRequest request =
       ListConversationModelEvaluationsRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (ConversationModelEvaluation element :
       conversationModelsClient.listConversationModelEvaluations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListConversationModelEvaluationsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ConversationModelsClient.ListConversationModelEvaluationsPagedResponse

listConversationModelEvaluations(String parent)

public final ConversationModelsClient.ListConversationModelEvaluationsPagedResponse listConversationModelEvaluations(String parent)

Lists evaluations of a conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   String parent = "parent-995424086";
   for (ConversationModelEvaluation element :
       conversationModelsClient.listConversationModelEvaluations(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The conversation model resource name. Format: projects/<Project ID>/conversationModels/<Conversation Model ID>

Returns
TypeDescription
ConversationModelsClient.ListConversationModelEvaluationsPagedResponse

listConversationModelEvaluationsCallable()

public final UnaryCallable<ListConversationModelEvaluationsRequest,ListConversationModelEvaluationsResponse> listConversationModelEvaluationsCallable()

Lists evaluations of a conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   ListConversationModelEvaluationsRequest request =
       ListConversationModelEvaluationsRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListConversationModelEvaluationsResponse response =
         conversationModelsClient.listConversationModelEvaluationsCallable().call(request);
     for (ConversationModelEvaluation element : response.getConversationModelEvaluationsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListConversationModelEvaluationsRequest,ListConversationModelEvaluationsResponse>

listConversationModelEvaluationsPagedCallable()

public final UnaryCallable<ListConversationModelEvaluationsRequest,ConversationModelsClient.ListConversationModelEvaluationsPagedResponse> listConversationModelEvaluationsPagedCallable()

Lists evaluations of a conversation model.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   ListConversationModelEvaluationsRequest request =
       ListConversationModelEvaluationsRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<ConversationModelEvaluation> future =
       conversationModelsClient
           .listConversationModelEvaluationsPagedCallable()
           .futureCall(request);
   // Do something.
   for (ConversationModelEvaluation element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListConversationModelEvaluationsRequest,ListConversationModelEvaluationsPagedResponse>

listConversationModels(ListConversationModelsRequest request)

public final ConversationModelsClient.ListConversationModelsPagedResponse listConversationModels(ListConversationModelsRequest request)

Lists conversation models.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   ListConversationModelsRequest request =
       ListConversationModelsRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (ConversationModel element :
       conversationModelsClient.listConversationModels(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListConversationModelsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ConversationModelsClient.ListConversationModelsPagedResponse

listConversationModels(String parent)

public final ConversationModelsClient.ListConversationModelsPagedResponse listConversationModels(String parent)

Lists conversation models.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   String parent = "parent-995424086";
   for (ConversationModel element :
       conversationModelsClient.listConversationModels(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The project to list all conversation models for. Format: projects/<Project ID>

Returns
TypeDescription
ConversationModelsClient.ListConversationModelsPagedResponse

listConversationModelsCallable()

public final UnaryCallable<ListConversationModelsRequest,ListConversationModelsResponse> listConversationModelsCallable()

Lists conversation models.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   ListConversationModelsRequest request =
       ListConversationModelsRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListConversationModelsResponse response =
         conversationModelsClient.listConversationModelsCallable().call(request);
     for (ConversationModel element : response.getConversationModelsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListConversationModelsRequest,ListConversationModelsResponse>

listConversationModelsPagedCallable()

public final UnaryCallable<ListConversationModelsRequest,ConversationModelsClient.ListConversationModelsPagedResponse> listConversationModelsPagedCallable()

Lists conversation models.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   ListConversationModelsRequest request =
       ListConversationModelsRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<ConversationModel> future =
       conversationModelsClient.listConversationModelsPagedCallable().futureCall(request);
   // Do something.
   for (ConversationModel element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListConversationModelsRequest,ListConversationModelsPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

undeployConversationModelAsync(UndeployConversationModelRequest request)

public final OperationFuture<Empty,UndeployConversationModelOperationMetadata> undeployConversationModelAsync(UndeployConversationModelRequest request)

Undeploys a model. If the model is not deployed this method has no effect. If the model is currently being used: - For article suggestion, article suggestion will fallback to the default model if model is undeployed.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: UndeployConversationModelOperationMetadata

  • response: An Empty message

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    UndeployConversationModelRequest request =
        UndeployConversationModelRequest.newBuilder().setName("name3373707").build();
    conversationModelsClient.undeployConversationModelAsync(request).get();
    }
    
Parameter
NameDescription
requestUndeployConversationModelRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Empty,UndeployConversationModelOperationMetadata>

undeployConversationModelCallable()

public final UnaryCallable<UndeployConversationModelRequest,Operation> undeployConversationModelCallable()

Undeploys a model. If the model is not deployed this method has no effect. If the model is currently being used: - For article suggestion, article suggestion will fallback to the default model if model is undeployed.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: UndeployConversationModelOperationMetadata

  • response: An Empty message

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    UndeployConversationModelRequest request =
        UndeployConversationModelRequest.newBuilder().setName("name3373707").build();
    ApiFuture<Operation> future =
        conversationModelsClient.undeployConversationModelCallable().futureCall(request);
    // Do something.
    future.get();
    }
    
Returns
TypeDescription
UnaryCallable<UndeployConversationModelRequest,Operation>

undeployConversationModelOperationCallable()

public final OperationCallable<UndeployConversationModelRequest,Empty,UndeployConversationModelOperationMetadata> undeployConversationModelOperationCallable()

Undeploys a model. If the model is not deployed this method has no effect. If the model is currently being used: - For article suggestion, article suggestion will fallback to the default model if model is undeployed.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

- metadata: UndeployConversationModelOperationMetadata

  • response: An Empty message

    Sample code:

    
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    UndeployConversationModelRequest request =
        UndeployConversationModelRequest.newBuilder().setName("name3373707").build();
    OperationFuture<Empty, UndeployConversationModelOperationMetadata> future =
        conversationModelsClient.undeployConversationModelOperationCallable().futureCall(request);
    // Do something.
    future.get();
    }
    
Returns
TypeDescription
OperationCallable<UndeployConversationModelRequest,Empty,UndeployConversationModelOperationMetadata>