Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::ConversationModels::Client.
Client for the ConversationModels service.
Manages a collection of models for human agent assistant.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the ConversationModels Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all ConversationModels clients ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the ConversationModels Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_conversation_model
def create_conversation_model(request, options = nil) -> ::Gapic::Operation
def create_conversation_model(parent: nil, conversation_model: nil) -> ::Gapic::Operation
Creates a model.
This method is a long-running
operation.
The returned Operation
type has the following method-specific fields:
metadata
: CreateConversationModelOperationMetadataresponse
: ConversationModel
def create_conversation_model(request, options = nil) -> ::Gapic::Operation
create_conversation_model
via a request object, either of type
Google::Cloud::Dialogflow::V2::CreateConversationModelRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_conversation_model(parent: nil, conversation_model: nil) -> ::Gapic::Operation
create_conversation_model
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — The project to create conversation model for. Format:
projects/<Project ID>
- conversation_model (::Google::Cloud::Dialogflow::V2::ConversationModel, ::Hash) — Required. The conversation model to create.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/v2" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new # Call the create_conversation_model method. result = client.create_conversation_model request # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done! timeout: 60 if result.response? p result.response else puts "No response received." end
#create_conversation_model_evaluation
def create_conversation_model_evaluation(request, options = nil) -> ::Gapic::Operation
def create_conversation_model_evaluation(parent: nil, conversation_model_evaluation: nil) -> ::Gapic::Operation
Creates evaluation of a conversation model.
def create_conversation_model_evaluation(request, options = nil) -> ::Gapic::Operation
create_conversation_model_evaluation
via a request object, either of type
Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_conversation_model_evaluation(parent: nil, conversation_model_evaluation: nil) -> ::Gapic::Operation
create_conversation_model_evaluation
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The conversation model resource name. Format:
projects/<Project ID>/locations/<Location ID>/conversationModels/<Conversation Model ID>
- conversation_model_evaluation (::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation, ::Hash) — Required. The conversation model evaluation to be created.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/v2" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new # Call the create_conversation_model_evaluation method. result = client.create_conversation_model_evaluation request # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done! timeout: 60 if result.response? p result.response else puts "No response received." end
#delete_conversation_model
def delete_conversation_model(request, options = nil) -> ::Gapic::Operation
def delete_conversation_model(name: nil) -> ::Gapic::Operation
Deletes a model.
This method is a long-running
operation.
The returned Operation
type has the following method-specific fields:
metadata
: DeleteConversationModelOperationMetadataresponse
: An Empty message
def delete_conversation_model(request, options = nil) -> ::Gapic::Operation
delete_conversation_model
via a request object, either of type
DeleteConversationModelRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_conversation_model(name: nil) -> ::Gapic::Operation
delete_conversation_model
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The conversation model to delete. Format:
projects/<Project ID>/conversationModels/<Conversation Model ID>
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/v2" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new # Call the delete_conversation_model method. result = client.delete_conversation_model request # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done! timeout: 60 if result.response? p result.response else puts "No response received." end
#deploy_conversation_model
def deploy_conversation_model(request, options = nil) -> ::Gapic::Operation
def deploy_conversation_model(name: nil) -> ::Gapic::Operation
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
: DeployConversationModelOperationMetadataresponse
: An Empty message
def deploy_conversation_model(request, options = nil) -> ::Gapic::Operation
deploy_conversation_model
via a request object, either of type
DeployConversationModelRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def deploy_conversation_model(name: nil) -> ::Gapic::Operation
deploy_conversation_model
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The conversation model to deploy. Format:
projects/<Project ID>/conversationModels/<Conversation Model ID>
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/v2" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new # Call the deploy_conversation_model method. result = client.deploy_conversation_model request # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done! timeout: 60 if result.response? p result.response else puts "No response received." end
#get_conversation_model
def get_conversation_model(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::ConversationModel
def get_conversation_model(name: nil) -> ::Google::Cloud::Dialogflow::V2::ConversationModel
Gets conversation model.
def get_conversation_model(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::ConversationModel
get_conversation_model
via a request object, either of type
GetConversationModelRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::GetConversationModelRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_conversation_model(name: nil) -> ::Google::Cloud::Dialogflow::V2::ConversationModel
get_conversation_model
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The conversation model to retrieve. Format:
projects/<Project ID>/conversationModels/<Conversation Model ID>
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::V2::ConversationModel)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/v2" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new # Call the get_conversation_model method. result = client.get_conversation_model request # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModel. p result
#get_conversation_model_evaluation
def get_conversation_model_evaluation(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation
def get_conversation_model_evaluation(name: nil) -> ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation
Gets an evaluation of conversation model.
def get_conversation_model_evaluation(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation
get_conversation_model_evaluation
via a request object, either of type
GetConversationModelEvaluationRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_conversation_model_evaluation(name: nil) -> ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation
get_conversation_model_evaluation
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The conversation model evaluation resource name. Format:
projects/<Project ID>/conversationModels/<Conversation Model ID>/evaluations/<Evaluation ID>
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/v2" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new # Call the get_conversation_model_evaluation method. result = client.get_conversation_model_evaluation request # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new ConversationModels client object.
- (config) — Configure the ConversationModels client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| config.timeout = 10.0 end
#list_conversation_model_evaluations
def list_conversation_model_evaluations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>
def list_conversation_model_evaluations(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>
Lists evaluations of a conversation model.
def list_conversation_model_evaluations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>
list_conversation_model_evaluations
via a request object, either of type
ListConversationModelEvaluationsRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_conversation_model_evaluations(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>
list_conversation_model_evaluations
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The conversation model resource name. Format:
projects/<Project ID>/conversationModels/<Conversation Model ID>
- page_size (::Integer) — Optional. Maximum number of evaluations to return in a single page. By default 100 and at most 1000.
- page_token (::String) — Optional. The next_page_token value returned from a previous list request.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/v2" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.new # Call the list_conversation_model_evaluations method. result = client.list_conversation_model_evaluations request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. p item end
#list_conversation_models
def list_conversation_models(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>
def list_conversation_models(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>
Lists conversation models.
def list_conversation_models(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>
list_conversation_models
via a request object, either of type
ListConversationModelsRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_conversation_models(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>
list_conversation_models
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The project to list all conversation models for.
Format:
projects/<Project ID>
- page_size (::Integer) — Optional. Maximum number of conversation models to return in a single page. By default 100 and at most 1000.
- page_token (::String) — Optional. The next_page_token value returned from a previous list request.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/v2" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.new # Call the list_conversation_models method. result = client.list_conversation_models request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationModel. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Client
Get the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#operations_client
def operations_client() -> ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations
Get the associated client for long-running operations.
#undeploy_conversation_model
def undeploy_conversation_model(request, options = nil) -> ::Gapic::Operation
def undeploy_conversation_model(name: nil) -> ::Gapic::Operation
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
: UndeployConversationModelOperationMetadataresponse
: An Empty message
def undeploy_conversation_model(request, options = nil) -> ::Gapic::Operation
undeploy_conversation_model
via a request object, either of type
UndeployConversationModelRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def undeploy_conversation_model(name: nil) -> ::Gapic::Operation
undeploy_conversation_model
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The conversation model to undeploy. Format:
projects/<Project ID>/conversationModels/<Conversation Model ID>
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/dialogflow/v2" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new # Call the undeploy_conversation_model method. result = client.undeploy_conversation_model request # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done! timeout: 60 if result.response? p result.response else puts "No response received." end
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)