Gemini Enterprise for Customer Experience V1BETA API - Class Google::Cloud::Ces::V1beta::AssistantService::Rest::Client (v1.2.0)

Reference documentation and code samples for the Gemini Enterprise for Customer Experience V1BETA API class Google::Cloud::Ces::V1beta::AssistantService::Rest::Client.

REST 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::Configuration

Configure the AssistantService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all AssistantService clients
::Google::Cloud::Ces::V1beta::AssistantService::Rest::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::ChatAiAssistantResponse

Runs Arc, the AI assistant, for the specified assistant session.

Overloads
def chat_ai_assistant(request, options = nil) -> ::Google::Cloud::Ces::V1beta::ChatAiAssistantResponse
Pass arguments to chat_ai_assistant via a request object, either of type ChatAiAssistantRequest or an equivalent Hash.
Parameters
  • 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::ChatAiAssistantResponse
Pass arguments to chat_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).
Parameters
  • 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.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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::Rest::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::Configuration

Configure 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.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#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::AssistantSession

Creates a new assistant session in the given app.

Overloads
def create_assistant_session(request, options = nil) -> ::Google::Cloud::Ces::V1beta::AssistantSession
Pass arguments to create_assistant_session via a request object, either of type CreateAssistantSessionRequest or an equivalent Hash.
Parameters
  • 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::AssistantSession
Pass arguments to create_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).
Parameters
  • 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.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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::Rest::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::Empty

Deletes the specified assistant session.

Overloads
def delete_assistant_session(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_assistant_session via a request object, either of type DeleteAssistantSessionRequest or an equivalent Hash.
Parameters
  • 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::Empty
Pass arguments to delete_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).
Parameter
  • name (::String) — Required. The name of the assistant session to delete. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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::Rest::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::AssistantSession

Gets details of the specified assistant session.

Overloads
def get_assistant_session(request, options = nil) -> ::Google::Cloud::Ces::V1beta::AssistantSession
Pass arguments to get_assistant_session via a request object, either of type GetAssistantSessionRequest or an equivalent Hash.
Parameters
  • 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::AssistantSession
Pass arguments to get_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).
Parameter
  • name (::String) — Required. The name of the assistant session to retrieve. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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::Rest::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| ... } -> Client

Create a new AssistantService REST client object.

Yields
  • (config) — Configure the AssistantService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Ces::V1beta::AssistantService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Ces::V1beta::AssistantService::Rest::Client.new do |config|
  config.timeout = 10.0
end

#list_assistant_sessions

def list_assistant_sessions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Ces::V1beta::AssistantSession>
def list_assistant_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Ces::V1beta::AssistantSession>

Lists all assistant sessions in the given app.

Overloads
def list_assistant_sessions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Ces::V1beta::AssistantSession>
Pass arguments to list_assistant_sessions via a request object, either of type ListAssistantSessionsRequest or an equivalent Hash.
Parameters
  • 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::Rest::PagedEnumerable<::Google::Cloud::Ces::V1beta::AssistantSession>
Pass arguments to 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).
Parameters
  • 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.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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::Rest::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::Rest::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Rest::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (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::RunAssistantResponse

Runs the assistant agent for the specified assistant session.

Overloads
def run_assistant(request, options = nil) -> ::Google::Cloud::Ces::V1beta::RunAssistantResponse
Pass arguments to run_assistant via a request object, either of type RunAssistantRequest or an equivalent Hash.
Parameters
  • 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::RunAssistantResponse
Pass arguments to run_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).
Parameters
  • 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.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

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::Rest::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() -> String

The effective universe domain

Returns
  • (String)