Gemini Enterprise for Customer Experience V1 API - Class Google::Cloud::Ces::V1::SessionService::Rest::Client (v0.1.0)

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

REST client for the SessionService service.

Session service provides APIs for interacting with CES agents.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the SessionService 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 SessionService clients
::Google::Cloud::Ces::V1::SessionService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the SessionService 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

#initialize

def initialize() { |config| ... } -> Client

Create a new SessionService REST client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::Ces::V1::SessionService::Rest::Client.new do |config|
  config.timeout = 10.0
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_session

def run_session(request, options = nil) -> ::Google::Cloud::Ces::V1::RunSessionResponse
def run_session(config: nil, inputs: nil) -> ::Google::Cloud::Ces::V1::RunSessionResponse

Initiates a single-turn interaction with the CES agent within a session.

Overloads
def run_session(request, options = nil) -> ::Google::Cloud::Ces::V1::RunSessionResponse
Pass arguments to run_session via a request object, either of type RunSessionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Ces::V1::RunSessionRequest, ::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_session(config: nil, inputs: nil) -> ::Google::Cloud::Ces::V1::RunSessionResponse
Pass arguments to run_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
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/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Ces::V1::SessionService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Ces::V1::RunSessionRequest.new

# Call the run_session method.
result = client.run_session request

# The returned object is of type Google::Cloud::Ces::V1::RunSessionResponse.
p result

#stream_run_session

def stream_run_session(request, options = nil) -> ::Enumerable<::Google::Cloud::Ces::V1::RunSessionResponse>
def stream_run_session(config: nil, inputs: nil) -> ::Enumerable<::Google::Cloud::Ces::V1::RunSessionResponse>

Initiates a single-turn interaction with the CES agent. Uses server-side streaming to deliver incremental results and partial responses as they are generated.

By default, complete responses (e.g., messages from callbacks or full LLM responses) are sent to the client as soon as they are available. To enable streaming individual text chunks directly from the model, set enable_text_streaming to true.

Overloads
def stream_run_session(request, options = nil) -> ::Enumerable<::Google::Cloud::Ces::V1::RunSessionResponse>
Pass arguments to stream_run_session via a request object, either of type RunSessionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Ces::V1::RunSessionRequest, ::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 stream_run_session(config: nil, inputs: nil) -> ::Enumerable<::Google::Cloud::Ces::V1::RunSessionResponse>
Pass arguments to stream_run_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
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/ces/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Ces::V1::SessionService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Ces::V1::RunSessionRequest.new

# Call the stream_run_session method to start streaming.
output = client.stream_run_session request

# The returned object is a streamed enumerable yielding elements of type
# ::Google::Cloud::Ces::V1::RunSessionResponse
output.each do |current_response|
  p current_response
end

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)