Class SessionsClient (1.0.0)

public abstract class SessionsClient

Sessions client wrapper, for convenient use.

Inheritance

System.Object > SessionsClient

Namespace

Google.Cloud.Dialogflow.Cx.V3

Assembly

Google.Cloud.Dialogflow.Cx.V3.dll

Remarks

A session represents an interaction with a user. You retrieve user input and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to determine user intent and respond.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
System.String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Sessions scopes.

Property Value
TypeDescription
System.Collections.Generic.IReadOnlyList<System.String>
Remarks

GrpcClient

public virtual Sessions.SessionsClient GrpcClient { get; }

The underlying gRPC Sessions client

Property Value
TypeDescription
Sessions.SessionsClient

Methods

Create()

public static SessionsClient Create()

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

Returns
TypeDescription
SessionsClient

The created SessionsClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenSystem.Threading.CancellationToken

The System.Threading.CancellationToken to use while creating the client.

Returns
TypeDescription
System.Threading.Tasks.Task<SessionsClient>

The task representing the created SessionsClient.

DetectIntent(DetectIntentRequest, CallSettings)

public virtual DetectIntentResponse DetectIntent(DetectIntentRequest request, CallSettings callSettings = null)

Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause session entity types to be updated, which in turn might affect results of future queries.

Note: Always use agent versions for production traffic. See Versions and environments.

Parameters
NameDescription
requestDetectIntentRequest

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

callSettingsGoogle.Api.Gax.Grpc.CallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DetectIntentResponse

The RPC response.

DetectIntentAsync(DetectIntentRequest, CallSettings)

public virtual Task<DetectIntentResponse> DetectIntentAsync(DetectIntentRequest request, CallSettings callSettings = null)

Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause session entity types to be updated, which in turn might affect results of future queries.

Note: Always use agent versions for production traffic. See Versions and environments.

Parameters
NameDescription
requestDetectIntentRequest

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

callSettingsGoogle.Api.Gax.Grpc.CallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
System.Threading.Tasks.Task<DetectIntentResponse>

A Task containing the RPC response.

DetectIntentAsync(DetectIntentRequest, CancellationToken)

public virtual Task<DetectIntentResponse> DetectIntentAsync(DetectIntentRequest request, CancellationToken cancellationToken)

Processes a natural language query and returns structured, actionable data as a result. This method is not idempotent, because it may cause session entity types to be updated, which in turn might affect results of future queries.

Note: Always use agent versions for production traffic. See Versions and environments.

Parameters
NameDescription
requestDetectIntentRequest

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

cancellationTokenSystem.Threading.CancellationToken

A System.Threading.CancellationToken to use for this RPC.

Returns
TypeDescription
System.Threading.Tasks.Task<DetectIntentResponse>

A Task containing the RPC response.

FulfillIntent(FulfillIntentRequest, CallSettings)

public virtual FulfillIntentResponse FulfillIntent(FulfillIntentRequest request, CallSettings callSettings = null)

Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined.

Parameters
NameDescription
requestFulfillIntentRequest

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

callSettingsGoogle.Api.Gax.Grpc.CallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
FulfillIntentResponse

The RPC response.

FulfillIntentAsync(FulfillIntentRequest, CallSettings)

public virtual Task<FulfillIntentResponse> FulfillIntentAsync(FulfillIntentRequest request, CallSettings callSettings = null)

Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined.

Parameters
NameDescription
requestFulfillIntentRequest

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

callSettingsGoogle.Api.Gax.Grpc.CallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
System.Threading.Tasks.Task<FulfillIntentResponse>

A Task containing the RPC response.

FulfillIntentAsync(FulfillIntentRequest, CancellationToken)

public virtual Task<FulfillIntentResponse> FulfillIntentAsync(FulfillIntentRequest request, CancellationToken cancellationToken)

Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined.

Parameters
NameDescription
requestFulfillIntentRequest

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

cancellationTokenSystem.Threading.CancellationToken

A System.Threading.CancellationToken to use for this RPC.

Returns
TypeDescription
System.Threading.Tasks.Task<FulfillIntentResponse>

A Task containing the RPC response.

MatchIntent(MatchIntentRequest, CallSettings)

public virtual MatchIntentResponse MatchIntent(MatchIntentRequest request, CallSettings callSettings = null)

Returns preliminary intent match results, doesn't change the session status.

Parameters
NameDescription
requestMatchIntentRequest

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

callSettingsGoogle.Api.Gax.Grpc.CallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
MatchIntentResponse

The RPC response.

MatchIntentAsync(MatchIntentRequest, CallSettings)

public virtual Task<MatchIntentResponse> MatchIntentAsync(MatchIntentRequest request, CallSettings callSettings = null)

Returns preliminary intent match results, doesn't change the session status.

Parameters
NameDescription
requestMatchIntentRequest

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

callSettingsGoogle.Api.Gax.Grpc.CallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
System.Threading.Tasks.Task<MatchIntentResponse>

A Task containing the RPC response.

MatchIntentAsync(MatchIntentRequest, CancellationToken)

public virtual Task<MatchIntentResponse> MatchIntentAsync(MatchIntentRequest request, CancellationToken cancellationToken)

Returns preliminary intent match results, doesn't change the session status.

Parameters
NameDescription
requestMatchIntentRequest

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

cancellationTokenSystem.Threading.CancellationToken

A System.Threading.CancellationToken to use for this RPC.

Returns
TypeDescription
System.Threading.Tasks.Task<MatchIntentResponse>

A Task containing the RPC response.

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
TypeDescription
System.Threading.Tasks.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.

StreamingDetectIntent(CallSettings, BidirectionalStreamingSettings)

public virtual SessionsClient.StreamingDetectIntentStream StreamingDetectIntent(CallSettings callSettings = null, BidirectionalStreamingSettings streamingSettings = null)

Processes a natural language query in audio format in a streaming fashion and returns structured, actionable data as a result. This method is only available via the gRPC API (not REST).

Note: Always use agent versions for production traffic. See Versions and environments.

Parameters
NameDescription
callSettingsGoogle.Api.Gax.Grpc.CallSettings

If not null, applies overrides to this RPC call.

streamingSettingsGoogle.Api.Gax.Grpc.BidirectionalStreamingSettings

If not null, applies streaming overrides to this RPC call.

Returns
TypeDescription
SessionsClient.StreamingDetectIntentStream

The client-server stream.