Class ConversationModelsClient (4.58.0)

GitHub RepositoryProduct Reference

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 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 (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().

Methods
Method Description Method Variants

CreateConversationModel

Creates a model.

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

- metadata: CreateConversationModelOperationMetadata - response: ConversationModel

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createConversationModelAsync(CreateConversationModelRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createConversationModelAsync(String parent, ConversationModel conversationModel)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createConversationModelOperationCallable()

  • createConversationModelCallable()

GetConversationModel

Gets conversation model.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getConversationModel(GetConversationModelRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getConversationModel(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getConversationModelCallable()

ListConversationModels

Lists conversation models.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listConversationModels(ListConversationModelsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listConversationModels(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listConversationModelsPagedCallable()

  • listConversationModelsCallable()

DeleteConversationModel

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

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteConversationModelAsync(DeleteConversationModelRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteConversationModelAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteConversationModelOperationCallable()

  • deleteConversationModelCallable()

DeployConversationModel

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

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deployConversationModelAsync(DeployConversationModelRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deployConversationModelOperationCallable()

  • deployConversationModelCallable()

UndeployConversationModel

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

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • undeployConversationModelAsync(UndeployConversationModelRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • undeployConversationModelOperationCallable()

  • undeployConversationModelCallable()

GetConversationModelEvaluation

Gets an evaluation of conversation model.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getConversationModelEvaluation(GetConversationModelEvaluationRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getConversationModelEvaluation(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getConversationModelEvaluationCallable()

ListConversationModelEvaluations

Lists evaluations of a conversation model.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listConversationModelEvaluations(ListConversationModelEvaluationsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listConversationModelEvaluations(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listConversationModelEvaluationsPagedCallable()

  • listConversationModelEvaluationsCallable()

CreateConversationModelEvaluation

Creates evaluation of a conversation model.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createConversationModelEvaluationAsync(CreateConversationModelEvaluationRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createConversationModelEvaluationAsync(ConversationModelName parent, ConversationModelEvaluation conversationModelEvaluation)

  • createConversationModelEvaluationAsync(String parent, ConversationModelEvaluation conversationModelEvaluation)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createConversationModelEvaluationOperationCallable()

  • createConversationModelEvaluationCallable()

ListLocations

Lists information about the supported locations for this service.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

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 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
 ConversationModelsSettings conversationModelsSettings =
     ConversationModelsSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ConversationModelsClient conversationModelsClient =
     ConversationModelsClient.create(conversationModelsSettings);
 

To customize the endpoint:


 // 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
 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 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
 ConversationModelsSettings conversationModelsSettings =
     ConversationModelsSettings.newHttpJsonBuilder().build();
 ConversationModelsClient conversationModelsClient =
     ConversationModelsClient.create(conversationModelsSettings);
 

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

Inheritance

java.lang.Object > ConversationModelsClient

Static Methods

create()

public static final ConversationModelsClient create()

Constructs an instance of ConversationModelsClient with default settings.

Returns
Type Description
ConversationModelsClient
Exceptions
Type Description
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
Name Description
settings ConversationModelsSettings
Returns
Type Description
ConversationModelsClient
Exceptions
Type Description
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
Name Description
stub ConversationModelsStub
Returns
Type Description
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
Name Description
settings ConversationModelsSettings

ConversationModelsClient(ConversationModelsStub stub)

protected ConversationModelsClient(ConversationModelsStub stub)
Parameter
Name Description
stub ConversationModelsStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    CreateConversationModelRequest request =
        CreateConversationModelRequest.newBuilder()
            .setParent("parent-995424086")
            .setConversationModel(ConversationModel.newBuilder().build())
            .build();
    ConversationModel response =
        conversationModelsClient.createConversationModelAsync(request).get();
    }
    
Parameter
Name Description
request CreateConversationModelRequest

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

Returns
Type Description
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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    String parent = "parent-995424086";
    ConversationModel conversationModel = ConversationModel.newBuilder().build();
    ConversationModel response =
        conversationModelsClient.createConversationModelAsync(parent, conversationModel).get();
    }
    
Parameters
Name Description
parent String

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

conversationModel ConversationModel

Required. The conversation model to create.

Returns
Type Description
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 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 (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
Type Description
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 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 (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
Name Description
parent ConversationModelName

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

conversationModelEvaluation ConversationModelEvaluation

Required. The conversation model evaluation to be created.

Returns
Type Description
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 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 (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
Name Description
request CreateConversationModelEvaluationRequest

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

Returns
Type Description
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 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 (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
Name Description
parent String

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

conversationModelEvaluation ConversationModelEvaluation

Required. The conversation model evaluation to be created.

Returns
Type Description
OperationFuture<ConversationModelEvaluation,CreateConversationModelEvaluationOperationMetadata>

createConversationModelEvaluationCallable()

public final UnaryCallable<CreateConversationModelEvaluationRequest,Operation> createConversationModelEvaluationCallable()

Creates evaluation of a conversation model.

Sample 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 (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
Type Description
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 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 (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
Type Description
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 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 (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
Type Description
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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    DeleteConversationModelRequest request =
        DeleteConversationModelRequest.newBuilder().setName("name3373707").build();
    conversationModelsClient.deleteConversationModelAsync(request).get();
    }
    
Parameter
Name Description
request DeleteConversationModelRequest

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

Returns
Type Description
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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    String name = "name3373707";
    conversationModelsClient.deleteConversationModelAsync(name).get();
    }
    
Parameter
Name Description
name String

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

Returns
Type Description
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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    DeleteConversationModelRequest request =
        DeleteConversationModelRequest.newBuilder().setName("name3373707").build();
    ApiFuture<Operation> future =
        conversationModelsClient.deleteConversationModelCallable().futureCall(request);
    // Do something.
    future.get();
    }
    
Returns
Type Description
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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    DeleteConversationModelRequest request =
        DeleteConversationModelRequest.newBuilder().setName("name3373707").build();
    OperationFuture<Empty, DeleteConversationModelOperationMetadata> future =
        conversationModelsClient.deleteConversationModelOperationCallable().futureCall(request);
    // Do something.
    future.get();
    }
    
Returns
Type Description
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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    DeployConversationModelRequest request =
        DeployConversationModelRequest.newBuilder().setName("name3373707").build();
    conversationModelsClient.deployConversationModelAsync(request).get();
    }
    
Parameter
Name Description
request DeployConversationModelRequest

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

Returns
Type Description
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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    DeployConversationModelRequest request =
        DeployConversationModelRequest.newBuilder().setName("name3373707").build();
    ApiFuture<Operation> future =
        conversationModelsClient.deployConversationModelCallable().futureCall(request);
    // Do something.
    future.get();
    }
    
Returns
Type Description
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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    DeployConversationModelRequest request =
        DeployConversationModelRequest.newBuilder().setName("name3373707").build();
    OperationFuture<Empty, DeployConversationModelOperationMetadata> future =
        conversationModelsClient.deployConversationModelOperationCallable().futureCall(request);
    // Do something.
    future.get();
    }
    
Returns
Type Description
OperationCallable<DeployConversationModelRequest,Empty,DeployConversationModelOperationMetadata>

getConversationModel(GetConversationModelRequest request)

public final ConversationModel getConversationModel(GetConversationModelRequest request)

Gets conversation model.

Sample 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   GetConversationModelRequest request =
       GetConversationModelRequest.newBuilder().setName("name3373707").build();
   ConversationModel response = conversationModelsClient.getConversationModel(request);
 }
 
Parameter
Name Description
request GetConversationModelRequest

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

Returns
Type Description
ConversationModel

getConversationModel(String name)

public final ConversationModel getConversationModel(String name)

Gets conversation model.

Sample 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   String name = "name3373707";
   ConversationModel response = conversationModelsClient.getConversationModel(name);
 }
 
Parameter
Name Description
name String

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

Returns
Type Description
ConversationModel

getConversationModelCallable()

public final UnaryCallable<GetConversationModelRequest,ConversationModel> getConversationModelCallable()

Gets conversation model.

Sample 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 (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
Type Description
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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   GetConversationModelEvaluationRequest request =
       GetConversationModelEvaluationRequest.newBuilder().setName("name3373707").build();
   ConversationModelEvaluation response =
       conversationModelsClient.getConversationModelEvaluation(request);
 }
 
Parameter
Name Description
request GetConversationModelEvaluationRequest

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

Returns
Type Description
ConversationModelEvaluation

getConversationModelEvaluation(String name)

public final ConversationModelEvaluation getConversationModelEvaluation(String name)

Gets an evaluation of conversation model.

Sample 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   String name = "name3373707";
   ConversationModelEvaluation response =
       conversationModelsClient.getConversationModelEvaluation(name);
 }
 
Parameter
Name Description
name String

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

Returns
Type Description
ConversationModelEvaluation

getConversationModelEvaluationCallable()

public final UnaryCallable<GetConversationModelEvaluationRequest,ConversationModelEvaluation> getConversationModelEvaluationCallable()

Gets an evaluation of conversation model.

Sample 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 (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
Type Description
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
Type Description
OperationsClient

getLocation(GetLocationRequest request)

public final Location getLocation(GetLocationRequest request)

Gets information about a location.

Sample 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = conversationModelsClient.getLocation(request);
 }
 
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

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

Returns
Type Description
com.google.cloud.location.Location

getLocationCallable()

public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Gets information about a location.

Sample 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future =
       conversationModelsClient.getLocationCallable().futureCall(request);
   // Do something.
   Location response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

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
Type Description
OperationsClient

getSettings()

public final ConversationModelsSettings getSettings()
Returns
Type Description
ConversationModelsSettings

getStub()

public ConversationModelsStub getStub()
Returns
Type Description
ConversationModelsStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
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 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 (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
Name Description
request ListConversationModelEvaluationsRequest

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

Returns
Type Description
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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   String parent = "parent-995424086";
   for (ConversationModelEvaluation element :
       conversationModelsClient.listConversationModelEvaluations(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

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

Returns
Type Description
ConversationModelsClient.ListConversationModelEvaluationsPagedResponse

listConversationModelEvaluationsCallable()

public final UnaryCallable<ListConversationModelEvaluationsRequest,ListConversationModelEvaluationsResponse> listConversationModelEvaluationsCallable()

Lists evaluations of a conversation model.

Sample 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 (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
Type Description
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 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 (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
Type Description
UnaryCallable<ListConversationModelEvaluationsRequest,ListConversationModelEvaluationsPagedResponse>

listConversationModels(ListConversationModelsRequest request)

public final ConversationModelsClient.ListConversationModelsPagedResponse listConversationModels(ListConversationModelsRequest request)

Lists conversation models.

Sample 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 (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
Name Description
request ListConversationModelsRequest

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

Returns
Type Description
ConversationModelsClient.ListConversationModelsPagedResponse

listConversationModels(String parent)

public final ConversationModelsClient.ListConversationModelsPagedResponse listConversationModels(String parent)

Lists conversation models.

Sample 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   String parent = "parent-995424086";
   for (ConversationModel element :
       conversationModelsClient.listConversationModels(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

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

Returns
Type Description
ConversationModelsClient.ListConversationModelsPagedResponse

listConversationModelsCallable()

public final UnaryCallable<ListConversationModelsRequest,ListConversationModelsResponse> listConversationModelsCallable()

Lists conversation models.

Sample 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 (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
Type Description
UnaryCallable<ListConversationModelsRequest,ListConversationModelsResponse>

listConversationModelsPagedCallable()

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

Lists conversation models.

Sample 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 (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
Type Description
UnaryCallable<ListConversationModelsRequest,ListConversationModelsPagedResponse>

listLocations(ListLocationsRequest request)

public final ConversationModelsClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.

Sample 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Location element : conversationModelsClient.listLocations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

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

Returns
Type Description
ConversationModelsClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.

Sample 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response =
         conversationModelsClient.listLocationsCallable().call(request);
     for (Location element : response.getLocationsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,ConversationModelsClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Lists information about the supported locations for this service.

Sample 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Location> future =
       conversationModelsClient.listLocationsPagedCallable().futureCall(request);
   // Do something.
   for (Location element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    UndeployConversationModelRequest request =
        UndeployConversationModelRequest.newBuilder().setName("name3373707").build();
    conversationModelsClient.undeployConversationModelAsync(request).get();
    }
    
Parameter
Name Description
request UndeployConversationModelRequest

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

Returns
Type Description
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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    UndeployConversationModelRequest request =
        UndeployConversationModelRequest.newBuilder().setName("name3373707").build();
    ApiFuture<Operation> future =
        conversationModelsClient.undeployConversationModelCallable().futureCall(request);
    // Do something.
    future.get();
    }
    
Returns
Type Description
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 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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
    UndeployConversationModelRequest request =
        UndeployConversationModelRequest.newBuilder().setName("name3373707").build();
    OperationFuture<Empty, UndeployConversationModelOperationMetadata> future =
        conversationModelsClient.undeployConversationModelOperationCallable().futureCall(request);
    // Do something.
    future.get();
    }
    
Returns
Type Description
OperationCallable<UndeployConversationModelRequest,Empty,UndeployConversationModelOperationMetadata>