Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.
Client for the ConversationDatasets service.
Conversation datasets.
Conversation datasets contain raw conversation files and their customizable metadata that can be used for model training.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the ConversationDatasets Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all ConversationDatasets clients ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the ConversationDatasets 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_dataset
def create_conversation_dataset(request, options = nil) -> ::Gapic::Operation
def create_conversation_dataset(parent: nil, conversation_dataset: nil) -> ::Gapic::Operation
Creates a new conversation dataset.
This method is a long-running
operation.
The returned Operation
type has the following method-specific fields:
metadata
: CreateConversationDatasetOperationMetadataresponse
: ConversationDataset
def create_conversation_dataset(request, options = nil) -> ::Gapic::Operation
create_conversation_dataset
via a request object, either of type
Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest, ::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_dataset(parent: nil, conversation_dataset: nil) -> ::Gapic::Operation
create_conversation_dataset
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 create conversation dataset for. Format:
projects/<Project ID>/locations/<Location ID>
- conversation_dataset (::Google::Cloud::Dialogflow::V2::ConversationDataset, ::Hash) — Required. The conversation dataset 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::ConversationDatasets::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new # Call the create_conversation_dataset method. result = client.create_conversation_dataset request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#delete_conversation_dataset
def delete_conversation_dataset(request, options = nil) -> ::Gapic::Operation
def delete_conversation_dataset(name: nil) -> ::Gapic::Operation
Deletes the specified conversation dataset.
This method is a long-running
operation.
The returned Operation
type has the following method-specific fields:
metadata
: DeleteConversationDatasetOperationMetadataresponse
: An Empty message
def delete_conversation_dataset(request, options = nil) -> ::Gapic::Operation
delete_conversation_dataset
via a request object, either of type
DeleteConversationDatasetRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest, ::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_dataset(name: nil) -> ::Gapic::Operation
delete_conversation_dataset
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 dataset to delete. Format:
projects/<Project ID>/locations/<Location ID>/conversationDatasets/<Conversation Dataset 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::ConversationDatasets::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new # Call the delete_conversation_dataset method. result = client.delete_conversation_dataset request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#get_conversation_dataset
def get_conversation_dataset(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::ConversationDataset
def get_conversation_dataset(name: nil) -> ::Google::Cloud::Dialogflow::V2::ConversationDataset
Retrieves the specified conversation dataset.
def get_conversation_dataset(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::ConversationDataset
get_conversation_dataset
via a request object, either of type
GetConversationDatasetRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest, ::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_dataset(name: nil) -> ::Google::Cloud::Dialogflow::V2::ConversationDataset
get_conversation_dataset
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 dataset to retrieve. Format:
projects/<Project ID>/locations/<Location ID>/conversationDatasets/<Conversation Dataset ID>
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Dialogflow::V2::ConversationDataset)
- 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::ConversationDatasets::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new # Call the get_conversation_dataset method. result = client.get_conversation_dataset request # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationDataset. p result
#import_conversation_data
def import_conversation_data(request, options = nil) -> ::Gapic::Operation
def import_conversation_data(name: nil, input_config: nil) -> ::Gapic::Operation
Import data into the specified conversation dataset. Note that it is not allowed to import data to a conversation dataset that already has data in it.
This method is a long-running
operation.
The returned Operation
type has the following method-specific fields:
metadata
: ImportConversationDataOperationMetadataresponse
: ImportConversationDataOperationResponse
def import_conversation_data(request, options = nil) -> ::Gapic::Operation
import_conversation_data
via a request object, either of type
ImportConversationDataRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest, ::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 import_conversation_data(name: nil, input_config: nil) -> ::Gapic::Operation
import_conversation_data
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. Dataset resource name. Format:
projects/<Project ID>/locations/<Location ID>/conversationDatasets/<Conversation Dataset ID>
- input_config (::Google::Cloud::Dialogflow::V2::InputConfig, ::Hash) — Required. Configuration describing where to import data from.
- (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::ConversationDatasets::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new # Call the import_conversation_data method. result = client.import_conversation_data request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#initialize
def initialize() { |config| ... } -> Client
Create a new ConversationDatasets client object.
- (config) — Configure the ConversationDatasets client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| config.timeout = 10.0 end
#list_conversation_datasets
def list_conversation_datasets(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>
def list_conversation_datasets(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>
Returns the list of all conversation datasets in the specified project and location.
def list_conversation_datasets(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>
list_conversation_datasets
via a request object, either of type
ListConversationDatasetsRequest or an equivalent Hash.
- request (::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest, ::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_datasets(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>
list_conversation_datasets
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 and location name to list all conversation datasets for.
Format:
projects/<Project ID>/locations/<Location ID>
- page_size (::Integer) — Optional. Maximum number of conversation datasets 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::ConversationDataset>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>)
- (::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::ConversationDatasets::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.new # Call the list_conversation_datasets method. result = client.list_conversation_datasets request # The returned object is of type Gapic::PagedEnumerable. You can # iterate over all elements by calling #each, and the enumerable # will lazily make API calls to fetch subsequent pages. Other # methods are also available for managing paging directly. result.each do |response| # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationDataset. p response end
#operations_client
def operations_client() -> ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations
Get the associated client for long-running operations.