Reference documentation and code samples for the Gemini Enterprise for Customer Experience V1BETA API class Google::Cloud::Ces::V1beta::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::ConfigurationConfigure the ToolService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all ToolService clients ::Google::Cloud::Ces::V1beta::ToolService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#execute_tool
def execute_tool(request, options = nil) -> ::Google::Cloud::Ces::V1beta::ExecuteToolResponse
def execute_tool(tool: nil, toolset_tool: nil, variables: nil, context: nil, parent: nil, args: nil, mock_config: nil) -> ::Google::Cloud::Ces::V1beta::ExecuteToolResponseExecutes the given tool with the given arguments.
def execute_tool(request, options = nil) -> ::Google::Cloud::Ces::V1beta::ExecuteToolResponseexecute_tool via a request object, either of type
ExecuteToolRequest or an equivalent Hash.
- request (::Google::Cloud::Ces::V1beta::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, mock_config: nil) -> ::Google::Cloud::Ces::V1beta::ExecuteToolResponseexecute_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).
-
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::V1beta::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.
- mock_config (::Google::Cloud::Ces::V1beta::MockConfig, ::Hash) — Optional. Mock configuration for the tool execution. If this field is set, tools that call other tools will be mocked based on the provided patterns and responses.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Ces::V1beta::ExecuteToolResponse)
- 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::ToolService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Ces::V1beta::ExecuteToolRequest.new # Call the execute_tool method. result = client.execute_tool request # The returned object is of type Google::Cloud::Ces::V1beta::ExecuteToolResponse. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new ToolService client object.
- (config) — Configure the ToolService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Ces::V1beta::ToolService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Ces::V1beta::ToolService::Client.new do |config| config.timeout = 10.0 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)
#retrieve_tool_schema
def retrieve_tool_schema(request, options = nil) -> ::Google::Cloud::Ces::V1beta::RetrieveToolSchemaResponse
def retrieve_tool_schema(tool: nil, toolset_tool: nil, parent: nil) -> ::Google::Cloud::Ces::V1beta::RetrieveToolSchemaResponseRetrieve the schema of the given tool. The schema is computed on the fly for the given instance of the tool.
def retrieve_tool_schema(request, options = nil) -> ::Google::Cloud::Ces::V1beta::RetrieveToolSchemaResponseretrieve_tool_schema via a request object, either of type
RetrieveToolSchemaRequest or an equivalent Hash.
- request (::Google::Cloud::Ces::V1beta::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::V1beta::RetrieveToolSchemaResponseretrieve_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).
-
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::V1beta::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}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Ces::V1beta::RetrieveToolSchemaResponse)
- 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::ToolService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Ces::V1beta::RetrieveToolSchemaRequest.new # Call the retrieve_tool_schema method. result = client.retrieve_tool_schema request # The returned object is of type Google::Cloud::Ces::V1beta::RetrieveToolSchemaResponse. p result
#retrieve_tools
def retrieve_tools(request, options = nil) -> ::Google::Cloud::Ces::V1beta::RetrieveToolsResponse
def retrieve_tools(toolset: nil, tool_ids: nil) -> ::Google::Cloud::Ces::V1beta::RetrieveToolsResponseRetrieve the list of tools included in the specified toolset.
def retrieve_tools(request, options = nil) -> ::Google::Cloud::Ces::V1beta::RetrieveToolsResponseretrieve_tools via a request object, either of type
RetrieveToolsRequest or an equivalent Hash.
- request (::Google::Cloud::Ces::V1beta::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::V1beta::RetrieveToolsResponseretrieve_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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Ces::V1beta::RetrieveToolsResponse)
- 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::ToolService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Ces::V1beta::RetrieveToolsRequest.new # Call the retrieve_tools method. result = client.retrieve_tools request # The returned object is of type Google::Cloud::Ces::V1beta::RetrieveToolsResponse. p result
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)