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

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

Client for the ToolService service.

Tool service provides APIs for interacting with CES tools.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

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

#execute_tool

def execute_tool(request, options = nil) -> ::Google::Cloud::Ces::V1::ExecuteToolResponse
def execute_tool(tool: nil, toolset_tool: nil, variables: nil, context: nil, parent: nil, args: nil) -> ::Google::Cloud::Ces::V1::ExecuteToolResponse

Executes the given tool with the given arguments.

Overloads
def execute_tool(request, options = nil) -> ::Google::Cloud::Ces::V1::ExecuteToolResponse
Pass arguments to execute_tool via a request object, either of type ExecuteToolRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Ces::V1::ExecuteToolRequest, ::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 execute_tool(tool: nil, toolset_tool: nil, variables: nil, context: nil, parent: nil, args: nil) -> ::Google::Cloud::Ces::V1::ExecuteToolResponse
Pass arguments to execute_tool 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
  • tool (::String) — Optional. The name of the tool to execute. Format: projects/{project}/locations/{location}/apps/{app}/tools/{tool}

    Note: The following parameters are mutually exclusive: tool, toolset_tool. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

  • toolset_tool (::Google::Cloud::Ces::V1::ToolsetTool, ::Hash) — Optional. The toolset tool to execute. Only one tool should match the predicate from the toolset. Otherwise, an error will be returned.

    Note: The following parameters are mutually exclusive: toolset_tool, tool. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

  • variables (::Google::Protobuf::Struct, ::Hash) — Optional. The variables that are available for the tool execution.

    Note: The following parameters are mutually exclusive: variables, context. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

  • context (::Google::Protobuf::Struct, ::Hash) — Optional. The ToolCallContext to be passed to the Python tool.

    Note: The following parameters are mutually exclusive: context, variables. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

  • parent (::String) — Required. The resource name of the app which the tool/toolset belongs to. Format: projects/{project}/locations/{location}/apps/{app}
  • args (::Google::Protobuf::Struct, ::Hash) — Optional. The input parameters and values for the tool in JSON object format.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC 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::ToolService::Client.new

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

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

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

#initialize

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

Create a new ToolService client object.

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

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

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

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

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

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#retrieve_tool_schema

def retrieve_tool_schema(request, options = nil) -> ::Google::Cloud::Ces::V1::RetrieveToolSchemaResponse
def retrieve_tool_schema(tool: nil, toolset_tool: nil, parent: nil) -> ::Google::Cloud::Ces::V1::RetrieveToolSchemaResponse

Retrieve the schema of the given tool. The schema is computed on the fly for the given instance of the tool.

Overloads
def retrieve_tool_schema(request, options = nil) -> ::Google::Cloud::Ces::V1::RetrieveToolSchemaResponse
Pass arguments to retrieve_tool_schema via a request object, either of type RetrieveToolSchemaRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Ces::V1::RetrieveToolSchemaRequest, ::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 retrieve_tool_schema(tool: nil, toolset_tool: nil, parent: nil) -> ::Google::Cloud::Ces::V1::RetrieveToolSchemaResponse
Pass arguments to retrieve_tool_schema 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
  • tool (::String) — Optional. The name of the tool to retrieve the schema for. Format: projects/{project}/locations/{location}/apps/{app}/tools/{tool}

    Note: The following parameters are mutually exclusive: tool, toolset_tool. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

  • toolset_tool (::Google::Cloud::Ces::V1::ToolsetTool, ::Hash) — Optional. The toolset tool to retrieve the schema for. Only one tool should match the predicate from the toolset. Otherwise, an error will be returned.

    Note: The following parameters are mutually exclusive: toolset_tool, tool. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

  • parent (::String) — Required. The resource name of the app which the tool/toolset belongs to. Format: projects/{project}/locations/{location}/apps/{app}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC 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::ToolService::Client.new

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

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

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

#retrieve_tools

def retrieve_tools(request, options = nil) -> ::Google::Cloud::Ces::V1::RetrieveToolsResponse
def retrieve_tools(toolset: nil, tool_ids: nil) -> ::Google::Cloud::Ces::V1::RetrieveToolsResponse

Retrieve the list of tools included in the specified toolset.

Overloads
def retrieve_tools(request, options = nil) -> ::Google::Cloud::Ces::V1::RetrieveToolsResponse
Pass arguments to retrieve_tools via a request object, either of type RetrieveToolsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Ces::V1::RetrieveToolsRequest, ::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 retrieve_tools(toolset: nil, tool_ids: nil) -> ::Google::Cloud::Ces::V1::RetrieveToolsResponse
Pass arguments to retrieve_tools 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
  • toolset (::String) — Required. The name of the toolset to retrieve the tools for. Format: projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}
  • tool_ids (::Array<::String>) — Optional. The identifiers of the tools to retrieve from the toolset. If empty, all tools in the toolset will be returned.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC 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::ToolService::Client.new

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

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

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

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)