Gemini Enterprise for Customer Experience v1 API - Class ToolServiceClient (1.0.0-beta01)

public abstract class ToolServiceClient

Reference documentation and code samples for the Gemini Enterprise for Customer Experience v1 API class ToolServiceClient.

ToolService client wrapper, for convenient use.

Inheritance

object > ToolServiceClient

Derived Types

Namespace

Google.Cloud.Ces.V1

Assembly

Google.Cloud.Ces.V1.dll

Remarks

Tool service provides APIs for interacting with CES tools.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the ToolService service, which is a host of "ces.googleapis.com" and a port of 443.

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default ToolService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

GrpcClient

public virtual ToolService.ToolServiceClient GrpcClient { get; }

The underlying gRPC ToolService client

Property Value
Type Description
ToolServiceToolServiceClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static ToolServiceClient Create()

Synchronously creates a ToolServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ToolServiceClientBuilder.

Returns
Type Description
ToolServiceClient

The created ToolServiceClient.

CreateAsync(CancellationToken)

public static Task<ToolServiceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a ToolServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ToolServiceClientBuilder.

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskToolServiceClient

The task representing the created ToolServiceClient.

ExecuteTool(ExecuteToolRequest, CallSettings)

public virtual ExecuteToolResponse ExecuteTool(ExecuteToolRequest request, CallSettings callSettings = null)

Executes the given tool with the given arguments.

Parameters
Name Description
request ExecuteToolRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ExecuteToolResponse

The RPC response.

Example
// Create client
ToolServiceClient toolServiceClient = ToolServiceClient.Create();
// Initialize request argument(s)
ExecuteToolRequest request = new ExecuteToolRequest
{
    ToolAsToolName = ToolName.FromProjectLocationAppTool("[PROJECT]", "[LOCATION]", "[APP]", "[TOOL]"),
    Args = new Struct(),
    ParentAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
};
// Make the request
ExecuteToolResponse response = toolServiceClient.ExecuteTool(request);

ExecuteToolAsync(ExecuteToolRequest, CallSettings)

public virtual Task<ExecuteToolResponse> ExecuteToolAsync(ExecuteToolRequest request, CallSettings callSettings = null)

Executes the given tool with the given arguments.

Parameters
Name Description
request ExecuteToolRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskExecuteToolResponse

A Task containing the RPC response.

Example
// Create client
ToolServiceClient toolServiceClient = await ToolServiceClient.CreateAsync();
// Initialize request argument(s)
ExecuteToolRequest request = new ExecuteToolRequest
{
    ToolAsToolName = ToolName.FromProjectLocationAppTool("[PROJECT]", "[LOCATION]", "[APP]", "[TOOL]"),
    Args = new Struct(),
    ParentAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
};
// Make the request
ExecuteToolResponse response = await toolServiceClient.ExecuteToolAsync(request);

ExecuteToolAsync(ExecuteToolRequest, CancellationToken)

public virtual Task<ExecuteToolResponse> ExecuteToolAsync(ExecuteToolRequest request, CancellationToken cancellationToken)

Executes the given tool with the given arguments.

Parameters
Name Description
request ExecuteToolRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskExecuteToolResponse

A Task containing the RPC response.

Example
// Create client
ToolServiceClient toolServiceClient = await ToolServiceClient.CreateAsync();
// Initialize request argument(s)
ExecuteToolRequest request = new ExecuteToolRequest
{
    ToolAsToolName = ToolName.FromProjectLocationAppTool("[PROJECT]", "[LOCATION]", "[APP]", "[TOOL]"),
    Args = new Struct(),
    ParentAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
};
// Make the request
ExecuteToolResponse response = await toolServiceClient.ExecuteToolAsync(request);

RetrieveToolSchema(RetrieveToolSchemaRequest, CallSettings)

public virtual RetrieveToolSchemaResponse RetrieveToolSchema(RetrieveToolSchemaRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request RetrieveToolSchemaRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RetrieveToolSchemaResponse

The RPC response.

Example
// Create client
ToolServiceClient toolServiceClient = ToolServiceClient.Create();
// Initialize request argument(s)
RetrieveToolSchemaRequest request = new RetrieveToolSchemaRequest
{
    ToolAsToolName = ToolName.FromProjectLocationAppTool("[PROJECT]", "[LOCATION]", "[APP]", "[TOOL]"),
    ParentAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
};
// Make the request
RetrieveToolSchemaResponse response = toolServiceClient.RetrieveToolSchema(request);

RetrieveToolSchemaAsync(RetrieveToolSchemaRequest, CallSettings)

public virtual Task<RetrieveToolSchemaResponse> RetrieveToolSchemaAsync(RetrieveToolSchemaRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request RetrieveToolSchemaRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskRetrieveToolSchemaResponse

A Task containing the RPC response.

Example
// Create client
ToolServiceClient toolServiceClient = await ToolServiceClient.CreateAsync();
// Initialize request argument(s)
RetrieveToolSchemaRequest request = new RetrieveToolSchemaRequest
{
    ToolAsToolName = ToolName.FromProjectLocationAppTool("[PROJECT]", "[LOCATION]", "[APP]", "[TOOL]"),
    ParentAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
};
// Make the request
RetrieveToolSchemaResponse response = await toolServiceClient.RetrieveToolSchemaAsync(request);

RetrieveToolSchemaAsync(RetrieveToolSchemaRequest, CancellationToken)

public virtual Task<RetrieveToolSchemaResponse> RetrieveToolSchemaAsync(RetrieveToolSchemaRequest request, CancellationToken cancellationToken)

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

Parameters
Name Description
request RetrieveToolSchemaRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskRetrieveToolSchemaResponse

A Task containing the RPC response.

Example
// Create client
ToolServiceClient toolServiceClient = await ToolServiceClient.CreateAsync();
// Initialize request argument(s)
RetrieveToolSchemaRequest request = new RetrieveToolSchemaRequest
{
    ToolAsToolName = ToolName.FromProjectLocationAppTool("[PROJECT]", "[LOCATION]", "[APP]", "[TOOL]"),
    ParentAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
};
// Make the request
RetrieveToolSchemaResponse response = await toolServiceClient.RetrieveToolSchemaAsync(request);

RetrieveTools(RetrieveToolsRequest, CallSettings)

public virtual RetrieveToolsResponse RetrieveTools(RetrieveToolsRequest request, CallSettings callSettings = null)

Retrieve the list of tools included in the specified toolset.

Parameters
Name Description
request RetrieveToolsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RetrieveToolsResponse

The RPC response.

Example
// Create client
ToolServiceClient toolServiceClient = ToolServiceClient.Create();
// Initialize request argument(s)
RetrieveToolsRequest request = new RetrieveToolsRequest
{
    ToolsetAsToolsetName = ToolsetName.FromProjectLocationAppToolset("[PROJECT]", "[LOCATION]", "[APP]", "[TOOLSET]"),
    ToolIds = { "", },
};
// Make the request
RetrieveToolsResponse response = toolServiceClient.RetrieveTools(request);

RetrieveToolsAsync(RetrieveToolsRequest, CallSettings)

public virtual Task<RetrieveToolsResponse> RetrieveToolsAsync(RetrieveToolsRequest request, CallSettings callSettings = null)

Retrieve the list of tools included in the specified toolset.

Parameters
Name Description
request RetrieveToolsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskRetrieveToolsResponse

A Task containing the RPC response.

Example
// Create client
ToolServiceClient toolServiceClient = await ToolServiceClient.CreateAsync();
// Initialize request argument(s)
RetrieveToolsRequest request = new RetrieveToolsRequest
{
    ToolsetAsToolsetName = ToolsetName.FromProjectLocationAppToolset("[PROJECT]", "[LOCATION]", "[APP]", "[TOOLSET]"),
    ToolIds = { "", },
};
// Make the request
RetrieveToolsResponse response = await toolServiceClient.RetrieveToolsAsync(request);

RetrieveToolsAsync(RetrieveToolsRequest, CancellationToken)

public virtual Task<RetrieveToolsResponse> RetrieveToolsAsync(RetrieveToolsRequest request, CancellationToken cancellationToken)

Retrieve the list of tools included in the specified toolset.

Parameters
Name Description
request RetrieveToolsRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskRetrieveToolsResponse

A Task containing the RPC response.

Example
// Create client
ToolServiceClient toolServiceClient = await ToolServiceClient.CreateAsync();
// Initialize request argument(s)
RetrieveToolsRequest request = new RetrieveToolsRequest
{
    ToolsetAsToolsetName = ToolsetName.FromProjectLocationAppToolset("[PROJECT]", "[LOCATION]", "[APP]", "[TOOLSET]"),
    ToolIds = { "", },
};
// Make the request
RetrieveToolsResponse response = await toolServiceClient.RetrieveToolsAsync(request);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.