Reference documentation and code samples for the Gemini Enterprise for Customer Experience V1BETA API class Google::Cloud::Ces::V1beta::AssistantService::Client.
Client for the AssistantService service.
The service that manages assistant-related resources in Customer Engagement Suite (CES). The assistant, Arc, is a conversational agent embedded in CES applications to help users with building their agents.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the AssistantService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all AssistantService clients ::Google::Cloud::Ces::V1beta::AssistantService::Client.configure do |config| config.timeout = 10.0 end
#chat_ai_assistant
def chat_ai_assistant(request, options = nil) -> ::Google::Cloud::Ces::V1beta::ChatAiAssistantResponse
def chat_ai_assistant(app: nil, assistant_session: nil, message: nil, attached_gcs_uris: nil, context_token: nil) -> ::Google::Cloud::Ces::V1beta::ChatAiAssistantResponseRuns Arc, the AI assistant, for the specified assistant session.
def chat_ai_assistant(request, options = nil) -> ::Google::Cloud::Ces::V1beta::ChatAiAssistantResponsechat_ai_assistant via a request object, either of type
ChatAiAssistantRequest or an equivalent Hash.
- request (::Google::Cloud::Ces::V1beta::ChatAiAssistantRequest, ::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 chat_ai_assistant(app: nil, assistant_session: nil, message: nil, attached_gcs_uris: nil, context_token: nil) -> ::Google::Cloud::Ces::V1beta::ChatAiAssistantResponsechat_ai_assistant 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).
-
app (::String) — Required. The app to run assistant for.
Format:
projects/{project}/locations/{location}/apps/{app} -
assistant_session (::String) — Required. The assistant session to be used to run the assistant.
Format:
projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session} - message (::String) — Required. The message to send to the assistant agent.
- attached_gcs_uris (::Array<::String>) — Optional. Cloud Storage URIs for files uploaded by the user during this turn. Example: "gs://cxas-transient-uploads/uuid/prd.pdf"
- context_token (::String) — Optional. Opaque onboarding context token returned by SessionService.GenerateOnboardingSuggestions. When set and still fresh, the server reuses the onboarding snapshot computed for the zero state instead of recomputing it for the first conversation turn.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Ces::V1beta::ChatAiAssistantResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/ces/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Ces::V1beta::AssistantService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Ces::V1beta::ChatAiAssistantRequest.new # Call the chat_ai_assistant method. result = client.chat_ai_assistant request # The returned object is of type Google::Cloud::Ces::V1beta::ChatAiAssistantResponse. p result
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the AssistantService 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_assistant_session
def create_assistant_session(request, options = nil) -> ::Google::Cloud::Ces::V1beta::AssistantSession
def create_assistant_session(parent: nil, assistant_session_id: nil, assistant_session_messages: nil) -> ::Google::Cloud::Ces::V1beta::AssistantSessionCreates a new assistant session in the given app.
def create_assistant_session(request, options = nil) -> ::Google::Cloud::Ces::V1beta::AssistantSessioncreate_assistant_session via a request object, either of type
CreateAssistantSessionRequest or an equivalent Hash.
- request (::Google::Cloud::Ces::V1beta::CreateAssistantSessionRequest, ::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_assistant_session(parent: nil, assistant_session_id: nil, assistant_session_messages: nil) -> ::Google::Cloud::Ces::V1beta::AssistantSessioncreate_assistant_session 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 app to create the assistant session in
Format:
projects/{project}/locations/{location}/apps/{app} - assistant_session_id (::String) — Optional. The ID to use for the assistant session, which will become the final component of the assistant session's resource name. If not provided, a unique ID will be automatically assigned for the assistant session.
- assistant_session_messages (::Array<::Google::Cloud::Ces::V1beta::AssistantMessage, ::Hash>) — Optional. The messages to seed the assistant session with.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Ces::V1beta::AssistantSession)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/ces/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Ces::V1beta::AssistantService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Ces::V1beta::CreateAssistantSessionRequest.new # Call the create_assistant_session method. result = client.create_assistant_session request # The returned object is of type Google::Cloud::Ces::V1beta::AssistantSession. p result
#delete_assistant_session
def delete_assistant_session(request, options = nil) -> ::Google::Protobuf::Empty
def delete_assistant_session(name: nil) -> ::Google::Protobuf::EmptyDeletes the specified assistant session.
def delete_assistant_session(request, options = nil) -> ::Google::Protobuf::Emptydelete_assistant_session via a request object, either of type
DeleteAssistantSessionRequest or an equivalent Hash.
- request (::Google::Cloud::Ces::V1beta::DeleteAssistantSessionRequest, ::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_assistant_session(name: nil) -> ::Google::Protobuf::Emptydelete_assistant_session 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 name of the assistant session to delete.
Format:
projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/ces/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Ces::V1beta::AssistantService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Ces::V1beta::DeleteAssistantSessionRequest.new # Call the delete_assistant_session method. result = client.delete_assistant_session request # The returned object is of type Google::Protobuf::Empty. p result
#get_assistant_session
def get_assistant_session(request, options = nil) -> ::Google::Cloud::Ces::V1beta::AssistantSession
def get_assistant_session(name: nil) -> ::Google::Cloud::Ces::V1beta::AssistantSessionGets details of the specified assistant session.
def get_assistant_session(request, options = nil) -> ::Google::Cloud::Ces::V1beta::AssistantSessionget_assistant_session via a request object, either of type
GetAssistantSessionRequest or an equivalent Hash.
- request (::Google::Cloud::Ces::V1beta::GetAssistantSessionRequest, ::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_assistant_session(name: nil) -> ::Google::Cloud::Ces::V1beta::AssistantSessionget_assistant_session 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 name of the assistant session to retrieve.
Format:
projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Ces::V1beta::AssistantSession)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/ces/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Ces::V1beta::AssistantService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Ces::V1beta::GetAssistantSessionRequest.new # Call the get_assistant_session method. result = client.get_assistant_session request # The returned object is of type Google::Cloud::Ces::V1beta::AssistantSession. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new AssistantService client object.
- (config) — Configure the AssistantService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Ces::V1beta::AssistantService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Ces::V1beta::AssistantService::Client.new do |config| config.timeout = 10.0 end
#list_assistant_sessions
def list_assistant_sessions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Ces::V1beta::AssistantSession>
def list_assistant_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Ces::V1beta::AssistantSession>Lists all assistant sessions in the given app.
def list_assistant_sessions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Ces::V1beta::AssistantSession>list_assistant_sessions via a request object, either of type
ListAssistantSessionsRequest or an equivalent Hash.
- request (::Google::Cloud::Ces::V1beta::ListAssistantSessionsRequest, ::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_assistant_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Ces::V1beta::AssistantSession>list_assistant_sessions 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 app to list assistant sessions from.
Format:
projects/{project}/locations/{location}/apps/{app} - page_size (::Integer) — Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.
- page_token (::String) — Optional. The next_page_token value returned from a previous list AssistantService.ListAssistantSessions call.
- filter (::String) — Optional. Filter to be applied when listing the assistant sessions. See https://google.aip.dev/160 for more details.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Ces::V1beta::AssistantSession>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Ces::V1beta::AssistantSession>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/ces/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Ces::V1beta::AssistantService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Ces::V1beta::ListAssistantSessionsRequest.new # Call the list_assistant_sessions method. result = client.list_assistant_sessions 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::Ces::V1beta::AssistantSession. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#run_assistant
def run_assistant(request, options = nil) -> ::Google::Cloud::Ces::V1beta::RunAssistantResponse
def run_assistant(app: nil, assistant_session: nil, message: nil, interaction_type: nil) -> ::Google::Cloud::Ces::V1beta::RunAssistantResponseRuns the assistant agent for the specified assistant session.
def run_assistant(request, options = nil) -> ::Google::Cloud::Ces::V1beta::RunAssistantResponserun_assistant via a request object, either of type
RunAssistantRequest or an equivalent Hash.
- request (::Google::Cloud::Ces::V1beta::RunAssistantRequest, ::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 run_assistant(app: nil, assistant_session: nil, message: nil, interaction_type: nil) -> ::Google::Cloud::Ces::V1beta::RunAssistantResponserun_assistant 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).
-
app (::String) — Required. The app to run assistant for.
Format:
projects/{project}/locations/{location}/apps/{app} -
assistant_session (::String) — Required. The assistant session to be used to run the assistant.
Format:
projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session} - message (::Google::Cloud::Ces::V1beta::AssistantMessage, ::Hash) — Required. The message to send to the assistant agent.
- interaction_type (::Google::Cloud::Ces::V1beta::RunAssistantRequest::InteractionType) — Optional. Different interaction types for the assistant message.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Ces::V1beta::RunAssistantResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/ces/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Ces::V1beta::AssistantService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Ces::V1beta::RunAssistantRequest.new # Call the run_assistant method. result = client.run_assistant request # The returned object is of type Google::Cloud::Ces::V1beta::RunAssistantResponse. p result
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)