Gemini Enterprise for Customer Experience v1beta API - Class AssistantServiceClient (1.0.0-beta10)

public abstract class AssistantServiceClient

Reference documentation and code samples for the Gemini Enterprise for Customer Experience v1beta API class AssistantServiceClient.

AssistantService client wrapper, for convenient use.

Inheritance

object > AssistantServiceClient

Namespace

Google.Cloud.Ces.V1Beta

Assembly

Google.Cloud.Ces.V1Beta.dll

Remarks

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.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the AssistantService 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 AssistantService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

GrpcClient

public virtual AssistantService.AssistantServiceClient GrpcClient { get; }

The underlying gRPC AssistantService client

Property Value
Type Description
AssistantServiceAssistantServiceClient

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

ChatAiAssistant(ChatAiAssistantRequest, CallSettings)

public virtual ChatAiAssistantResponse ChatAiAssistant(ChatAiAssistantRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request ChatAiAssistantRequest

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
ChatAiAssistantResponse

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
ChatAiAssistantRequest request = new ChatAiAssistantRequest
{
    AppAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
    AssistantSessionAsAssistantSessionName = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]"),
    Message = "",
    AttachedGcsUris = { "", },
    ContextToken = "",
};
// Make the request
ChatAiAssistantResponse response = assistantServiceClient.ChatAiAssistant(request);

ChatAiAssistantAsync(ChatAiAssistantRequest, CallSettings)

public virtual Task<ChatAiAssistantResponse> ChatAiAssistantAsync(ChatAiAssistantRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request ChatAiAssistantRequest

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
TaskChatAiAssistantResponse

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
ChatAiAssistantRequest request = new ChatAiAssistantRequest
{
    AppAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
    AssistantSessionAsAssistantSessionName = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]"),
    Message = "",
    AttachedGcsUris = { "", },
    ContextToken = "",
};
// Make the request
ChatAiAssistantResponse response = await assistantServiceClient.ChatAiAssistantAsync(request);

ChatAiAssistantAsync(ChatAiAssistantRequest, CancellationToken)

public virtual Task<ChatAiAssistantResponse> ChatAiAssistantAsync(ChatAiAssistantRequest request, CancellationToken cancellationToken)

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

Parameters
Name Description
request ChatAiAssistantRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskChatAiAssistantResponse

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
ChatAiAssistantRequest request = new ChatAiAssistantRequest
{
    AppAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
    AssistantSessionAsAssistantSessionName = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]"),
    Message = "",
    AttachedGcsUris = { "", },
    ContextToken = "",
};
// Make the request
ChatAiAssistantResponse response = await assistantServiceClient.ChatAiAssistantAsync(request);

Create()

public static AssistantServiceClient Create()

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

Returns
Type Description
AssistantServiceClient

The created AssistantServiceClient.

CreateAssistantSession(AppName, string, CallSettings)

public virtual AssistantSession CreateAssistantSession(AppName parent, string assistantSessionId, CallSettings callSettings = null)

Creates a new assistant session in the given app.

Parameters
Name Description
parent AppName

Required. The app to create the assistant session in Format: projects/{project}/locations/{location}/apps/{app}

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AssistantSession

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
AppName parent = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]");
string assistantSessionId = "";
// Make the request
AssistantSession response = assistantServiceClient.CreateAssistantSession(parent, assistantSessionId);

CreateAssistantSession(CreateAssistantSessionRequest, CallSettings)

public virtual AssistantSession CreateAssistantSession(CreateAssistantSessionRequest request, CallSettings callSettings = null)

Creates a new assistant session in the given app.

Parameters
Name Description
request CreateAssistantSessionRequest

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
AssistantSession

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
CreateAssistantSessionRequest request = new CreateAssistantSessionRequest
{
    ParentAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
    AssistantSessionId = "",
    AssistantSessionMessages =
    {
        new AssistantMessage(),
    },
};
// Make the request
AssistantSession response = assistantServiceClient.CreateAssistantSession(request);

CreateAssistantSession(string, string, CallSettings)

public virtual AssistantSession CreateAssistantSession(string parent, string assistantSessionId, CallSettings callSettings = null)

Creates a new assistant session in the given app.

Parameters
Name Description
parent string

Required. The app to create the assistant session in Format: projects/{project}/locations/{location}/apps/{app}

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AssistantSession

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/apps/[APP]";
string assistantSessionId = "";
// Make the request
AssistantSession response = assistantServiceClient.CreateAssistantSession(parent, assistantSessionId);

CreateAssistantSessionAsync(AppName, string, CallSettings)

public virtual Task<AssistantSession> CreateAssistantSessionAsync(AppName parent, string assistantSessionId, CallSettings callSettings = null)

Creates a new assistant session in the given app.

Parameters
Name Description
parent AppName

Required. The app to create the assistant session in Format: projects/{project}/locations/{location}/apps/{app}

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAssistantSession

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
AppName parent = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]");
string assistantSessionId = "";
// Make the request
AssistantSession response = await assistantServiceClient.CreateAssistantSessionAsync(parent, assistantSessionId);

CreateAssistantSessionAsync(AppName, string, CancellationToken)

public virtual Task<AssistantSession> CreateAssistantSessionAsync(AppName parent, string assistantSessionId, CancellationToken cancellationToken)

Creates a new assistant session in the given app.

Parameters
Name Description
parent AppName

Required. The app to create the assistant session in Format: projects/{project}/locations/{location}/apps/{app}

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAssistantSession

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
AppName parent = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]");
string assistantSessionId = "";
// Make the request
AssistantSession response = await assistantServiceClient.CreateAssistantSessionAsync(parent, assistantSessionId);

CreateAssistantSessionAsync(CreateAssistantSessionRequest, CallSettings)

public virtual Task<AssistantSession> CreateAssistantSessionAsync(CreateAssistantSessionRequest request, CallSettings callSettings = null)

Creates a new assistant session in the given app.

Parameters
Name Description
request CreateAssistantSessionRequest

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
TaskAssistantSession

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAssistantSessionRequest request = new CreateAssistantSessionRequest
{
    ParentAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
    AssistantSessionId = "",
    AssistantSessionMessages =
    {
        new AssistantMessage(),
    },
};
// Make the request
AssistantSession response = await assistantServiceClient.CreateAssistantSessionAsync(request);

CreateAssistantSessionAsync(CreateAssistantSessionRequest, CancellationToken)

public virtual Task<AssistantSession> CreateAssistantSessionAsync(CreateAssistantSessionRequest request, CancellationToken cancellationToken)

Creates a new assistant session in the given app.

Parameters
Name Description
request CreateAssistantSessionRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAssistantSession

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAssistantSessionRequest request = new CreateAssistantSessionRequest
{
    ParentAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
    AssistantSessionId = "",
    AssistantSessionMessages =
    {
        new AssistantMessage(),
    },
};
// Make the request
AssistantSession response = await assistantServiceClient.CreateAssistantSessionAsync(request);

CreateAssistantSessionAsync(string, string, CallSettings)

public virtual Task<AssistantSession> CreateAssistantSessionAsync(string parent, string assistantSessionId, CallSettings callSettings = null)

Creates a new assistant session in the given app.

Parameters
Name Description
parent string

Required. The app to create the assistant session in Format: projects/{project}/locations/{location}/apps/{app}

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAssistantSession

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/apps/[APP]";
string assistantSessionId = "";
// Make the request
AssistantSession response = await assistantServiceClient.CreateAssistantSessionAsync(parent, assistantSessionId);

CreateAssistantSessionAsync(string, string, CancellationToken)

public virtual Task<AssistantSession> CreateAssistantSessionAsync(string parent, string assistantSessionId, CancellationToken cancellationToken)

Creates a new assistant session in the given app.

Parameters
Name Description
parent string

Required. The app to create the assistant session in Format: projects/{project}/locations/{location}/apps/{app}

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAssistantSession

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/apps/[APP]";
string assistantSessionId = "";
// Make the request
AssistantSession response = await assistantServiceClient.CreateAssistantSessionAsync(parent, assistantSessionId);

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskAssistantServiceClient

The task representing the created AssistantServiceClient.

DeleteAssistantSession(AssistantSessionName, CallSettings)

public virtual void DeleteAssistantSession(AssistantSessionName name, CallSettings callSettings = null)

Deletes the specified assistant session.

Parameters
Name Description
name AssistantSessionName

Required. The name of the assistant session to delete. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
AssistantSessionName name = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]");
// Make the request
assistantServiceClient.DeleteAssistantSession(name);

DeleteAssistantSession(DeleteAssistantSessionRequest, CallSettings)

public virtual void DeleteAssistantSession(DeleteAssistantSessionRequest request, CallSettings callSettings = null)

Deletes the specified assistant session.

Parameters
Name Description
request DeleteAssistantSessionRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
DeleteAssistantSessionRequest request = new DeleteAssistantSessionRequest
{
    AssistantSessionName = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]"),
};
// Make the request
assistantServiceClient.DeleteAssistantSession(request);

DeleteAssistantSession(string, CallSettings)

public virtual void DeleteAssistantSession(string name, CallSettings callSettings = null)

Deletes the specified assistant session.

Parameters
Name Description
name string

Required. The name of the assistant session to delete. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/apps/[APP]/assistantSessions/[ASSISTANT_SESSION]";
// Make the request
assistantServiceClient.DeleteAssistantSession(name);

DeleteAssistantSessionAsync(AssistantSessionName, CallSettings)

public virtual Task DeleteAssistantSessionAsync(AssistantSessionName name, CallSettings callSettings = null)

Deletes the specified assistant session.

Parameters
Name Description
name AssistantSessionName

Required. The name of the assistant session to delete. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
AssistantSessionName name = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]");
// Make the request
await assistantServiceClient.DeleteAssistantSessionAsync(name);

DeleteAssistantSessionAsync(AssistantSessionName, CancellationToken)

public virtual Task DeleteAssistantSessionAsync(AssistantSessionName name, CancellationToken cancellationToken)

Deletes the specified assistant session.

Parameters
Name Description
name AssistantSessionName

Required. The name of the assistant session to delete. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
AssistantSessionName name = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]");
// Make the request
await assistantServiceClient.DeleteAssistantSessionAsync(name);

DeleteAssistantSessionAsync(DeleteAssistantSessionRequest, CallSettings)

public virtual Task DeleteAssistantSessionAsync(DeleteAssistantSessionRequest request, CallSettings callSettings = null)

Deletes the specified assistant session.

Parameters
Name Description
request DeleteAssistantSessionRequest

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
Task

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAssistantSessionRequest request = new DeleteAssistantSessionRequest
{
    AssistantSessionName = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]"),
};
// Make the request
await assistantServiceClient.DeleteAssistantSessionAsync(request);

DeleteAssistantSessionAsync(DeleteAssistantSessionRequest, CancellationToken)

public virtual Task DeleteAssistantSessionAsync(DeleteAssistantSessionRequest request, CancellationToken cancellationToken)

Deletes the specified assistant session.

Parameters
Name Description
request DeleteAssistantSessionRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAssistantSessionRequest request = new DeleteAssistantSessionRequest
{
    AssistantSessionName = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]"),
};
// Make the request
await assistantServiceClient.DeleteAssistantSessionAsync(request);

DeleteAssistantSessionAsync(string, CallSettings)

public virtual Task DeleteAssistantSessionAsync(string name, CallSettings callSettings = null)

Deletes the specified assistant session.

Parameters
Name Description
name string

Required. The name of the assistant session to delete. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/apps/[APP]/assistantSessions/[ASSISTANT_SESSION]";
// Make the request
await assistantServiceClient.DeleteAssistantSessionAsync(name);

DeleteAssistantSessionAsync(string, CancellationToken)

public virtual Task DeleteAssistantSessionAsync(string name, CancellationToken cancellationToken)

Deletes the specified assistant session.

Parameters
Name Description
name string

Required. The name of the assistant session to delete. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/apps/[APP]/assistantSessions/[ASSISTANT_SESSION]";
// Make the request
await assistantServiceClient.DeleteAssistantSessionAsync(name);

GetAssistantSession(AssistantSessionName, CallSettings)

public virtual AssistantSession GetAssistantSession(AssistantSessionName name, CallSettings callSettings = null)

Gets details of the specified assistant session.

Parameters
Name Description
name AssistantSessionName

Required. The name of the assistant session to retrieve. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AssistantSession

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
AssistantSessionName name = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]");
// Make the request
AssistantSession response = assistantServiceClient.GetAssistantSession(name);

GetAssistantSession(GetAssistantSessionRequest, CallSettings)

public virtual AssistantSession GetAssistantSession(GetAssistantSessionRequest request, CallSettings callSettings = null)

Gets details of the specified assistant session.

Parameters
Name Description
request GetAssistantSessionRequest

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
AssistantSession

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
GetAssistantSessionRequest request = new GetAssistantSessionRequest
{
    AssistantSessionName = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]"),
};
// Make the request
AssistantSession response = assistantServiceClient.GetAssistantSession(request);

GetAssistantSession(string, CallSettings)

public virtual AssistantSession GetAssistantSession(string name, CallSettings callSettings = null)

Gets details of the specified assistant session.

Parameters
Name Description
name string

Required. The name of the assistant session to retrieve. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AssistantSession

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/apps/[APP]/assistantSessions/[ASSISTANT_SESSION]";
// Make the request
AssistantSession response = assistantServiceClient.GetAssistantSession(name);

GetAssistantSessionAsync(AssistantSessionName, CallSettings)

public virtual Task<AssistantSession> GetAssistantSessionAsync(AssistantSessionName name, CallSettings callSettings = null)

Gets details of the specified assistant session.

Parameters
Name Description
name AssistantSessionName

Required. The name of the assistant session to retrieve. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAssistantSession

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
AssistantSessionName name = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]");
// Make the request
AssistantSession response = await assistantServiceClient.GetAssistantSessionAsync(name);

GetAssistantSessionAsync(AssistantSessionName, CancellationToken)

public virtual Task<AssistantSession> GetAssistantSessionAsync(AssistantSessionName name, CancellationToken cancellationToken)

Gets details of the specified assistant session.

Parameters
Name Description
name AssistantSessionName

Required. The name of the assistant session to retrieve. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAssistantSession

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
AssistantSessionName name = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]");
// Make the request
AssistantSession response = await assistantServiceClient.GetAssistantSessionAsync(name);

GetAssistantSessionAsync(GetAssistantSessionRequest, CallSettings)

public virtual Task<AssistantSession> GetAssistantSessionAsync(GetAssistantSessionRequest request, CallSettings callSettings = null)

Gets details of the specified assistant session.

Parameters
Name Description
request GetAssistantSessionRequest

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
TaskAssistantSession

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
GetAssistantSessionRequest request = new GetAssistantSessionRequest
{
    AssistantSessionName = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]"),
};
// Make the request
AssistantSession response = await assistantServiceClient.GetAssistantSessionAsync(request);

GetAssistantSessionAsync(GetAssistantSessionRequest, CancellationToken)

public virtual Task<AssistantSession> GetAssistantSessionAsync(GetAssistantSessionRequest request, CancellationToken cancellationToken)

Gets details of the specified assistant session.

Parameters
Name Description
request GetAssistantSessionRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAssistantSession

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
GetAssistantSessionRequest request = new GetAssistantSessionRequest
{
    AssistantSessionName = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]"),
};
// Make the request
AssistantSession response = await assistantServiceClient.GetAssistantSessionAsync(request);

GetAssistantSessionAsync(string, CallSettings)

public virtual Task<AssistantSession> GetAssistantSessionAsync(string name, CallSettings callSettings = null)

Gets details of the specified assistant session.

Parameters
Name Description
name string

Required. The name of the assistant session to retrieve. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAssistantSession

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/apps/[APP]/assistantSessions/[ASSISTANT_SESSION]";
// Make the request
AssistantSession response = await assistantServiceClient.GetAssistantSessionAsync(name);

GetAssistantSessionAsync(string, CancellationToken)

public virtual Task<AssistantSession> GetAssistantSessionAsync(string name, CancellationToken cancellationToken)

Gets details of the specified assistant session.

Parameters
Name Description
name string

Required. The name of the assistant session to retrieve. Format: projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAssistantSession

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/apps/[APP]/assistantSessions/[ASSISTANT_SESSION]";
// Make the request
AssistantSession response = await assistantServiceClient.GetAssistantSessionAsync(name);

ListAssistantSessions(AppName, string, int?, CallSettings)

public virtual PagedEnumerable<ListAssistantSessionsResponse, AssistantSession> ListAssistantSessions(AppName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all assistant sessions in the given app.

Parameters
Name Description
parent AppName

Required. The app to list assistant sessions from. Format: projects/{project}/locations/{location}/apps/{app}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAssistantSessionsResponseAssistantSession

A pageable sequence of AssistantSession resources.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
AppName parent = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]");
// Make the request
PagedEnumerable<ListAssistantSessionsResponse, AssistantSession> response = assistantServiceClient.ListAssistantSessions(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (AssistantSession item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAssistantSessionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AssistantSession item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AssistantSession> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AssistantSession item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAssistantSessions(ListAssistantSessionsRequest, CallSettings)

public virtual PagedEnumerable<ListAssistantSessionsResponse, AssistantSession> ListAssistantSessions(ListAssistantSessionsRequest request, CallSettings callSettings = null)

Lists all assistant sessions in the given app.

Parameters
Name Description
request ListAssistantSessionsRequest

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
PagedEnumerableListAssistantSessionsResponseAssistantSession

A pageable sequence of AssistantSession resources.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
ListAssistantSessionsRequest request = new ListAssistantSessionsRequest
{
    ParentAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListAssistantSessionsResponse, AssistantSession> response = assistantServiceClient.ListAssistantSessions(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (AssistantSession item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAssistantSessionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AssistantSession item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AssistantSession> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AssistantSession item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAssistantSessions(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListAssistantSessionsResponse, AssistantSession> ListAssistantSessions(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all assistant sessions in the given app.

Parameters
Name Description
parent string

Required. The app to list assistant sessions from. Format: projects/{project}/locations/{location}/apps/{app}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAssistantSessionsResponseAssistantSession

A pageable sequence of AssistantSession resources.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/apps/[APP]";
// Make the request
PagedEnumerable<ListAssistantSessionsResponse, AssistantSession> response = assistantServiceClient.ListAssistantSessions(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (AssistantSession item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAssistantSessionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AssistantSession item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AssistantSession> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AssistantSession item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAssistantSessionsAsync(AppName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAssistantSessionsResponse, AssistantSession> ListAssistantSessionsAsync(AppName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all assistant sessions in the given app.

Parameters
Name Description
parent AppName

Required. The app to list assistant sessions from. Format: projects/{project}/locations/{location}/apps/{app}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAssistantSessionsResponseAssistantSession

A pageable asynchronous sequence of AssistantSession resources.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
AppName parent = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]");
// Make the request
PagedAsyncEnumerable<ListAssistantSessionsResponse, AssistantSession> response = assistantServiceClient.ListAssistantSessionsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (AssistantSession item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListAssistantSessionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AssistantSession item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AssistantSession> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AssistantSession item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAssistantSessionsAsync(ListAssistantSessionsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListAssistantSessionsResponse, AssistantSession> ListAssistantSessionsAsync(ListAssistantSessionsRequest request, CallSettings callSettings = null)

Lists all assistant sessions in the given app.

Parameters
Name Description
request ListAssistantSessionsRequest

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
PagedAsyncEnumerableListAssistantSessionsResponseAssistantSession

A pageable asynchronous sequence of AssistantSession resources.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
ListAssistantSessionsRequest request = new ListAssistantSessionsRequest
{
    ParentAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListAssistantSessionsResponse, AssistantSession> response = assistantServiceClient.ListAssistantSessionsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await foreach (AssistantSession item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListAssistantSessionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AssistantSession item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AssistantSession> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AssistantSession item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAssistantSessionsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAssistantSessionsResponse, AssistantSession> ListAssistantSessionsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all assistant sessions in the given app.

Parameters
Name Description
parent string

Required. The app to list assistant sessions from. Format: projects/{project}/locations/{location}/apps/{app}

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAssistantSessionsResponseAssistantSession

A pageable asynchronous sequence of AssistantSession resources.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/apps/[APP]";
// Make the request
PagedAsyncEnumerable<ListAssistantSessionsResponse, AssistantSession> response = assistantServiceClient.ListAssistantSessionsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (AssistantSession item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListAssistantSessionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AssistantSession item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AssistantSession> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AssistantSession item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

RunAssistant(RunAssistantRequest, CallSettings)

public virtual RunAssistantResponse RunAssistant(RunAssistantRequest request, CallSettings callSettings = null)

Runs the assistant agent for the specified assistant session.

Parameters
Name Description
request RunAssistantRequest

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
RunAssistantResponse

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
RunAssistantRequest request = new RunAssistantRequest
{
    AppAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
    AssistantSessionAsAssistantSessionName = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]"),
    Message = new AssistantMessage(),
    InteractionType = RunAssistantRequest.Types.InteractionType.Unspecified,
};
// Make the request
RunAssistantResponse response = assistantServiceClient.RunAssistant(request);

RunAssistantAsync(RunAssistantRequest, CallSettings)

public virtual Task<RunAssistantResponse> RunAssistantAsync(RunAssistantRequest request, CallSettings callSettings = null)

Runs the assistant agent for the specified assistant session.

Parameters
Name Description
request RunAssistantRequest

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
TaskRunAssistantResponse

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
RunAssistantRequest request = new RunAssistantRequest
{
    AppAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
    AssistantSessionAsAssistantSessionName = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]"),
    Message = new AssistantMessage(),
    InteractionType = RunAssistantRequest.Types.InteractionType.Unspecified,
};
// Make the request
RunAssistantResponse response = await assistantServiceClient.RunAssistantAsync(request);

RunAssistantAsync(RunAssistantRequest, CancellationToken)

public virtual Task<RunAssistantResponse> RunAssistantAsync(RunAssistantRequest request, CancellationToken cancellationToken)

Runs the assistant agent for the specified assistant session.

Parameters
Name Description
request RunAssistantRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskRunAssistantResponse

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
RunAssistantRequest request = new RunAssistantRequest
{
    AppAsAppName = AppName.FromProjectLocationApp("[PROJECT]", "[LOCATION]", "[APP]"),
    AssistantSessionAsAssistantSessionName = AssistantSessionName.FromProjectLocationAppAssistantSession("[PROJECT]", "[LOCATION]", "[APP]", "[ASSISTANT_SESSION]"),
    Message = new AssistantMessage(),
    InteractionType = RunAssistantRequest.Types.InteractionType.Unspecified,
};
// Make the request
RunAssistantResponse response = await assistantServiceClient.RunAssistantAsync(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.