public abstract class SessionsClient
Sessions client wrapper, for convenient use.
Inheritance
System.Object > SessionsClientNamespace
Google.Cloud.Dialogflow.Cx.V3Assembly
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 | |
---|---|
Type | Description |
System.String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default Sessions scopes.
Property Value | |
---|---|
Type | Description |
System.Collections.Generic.IReadOnlyList<System.String> |
The default Sessions scopes are:
GrpcClient
public virtual Sessions.SessionsClient GrpcClient { get; }
The underlying gRPC Sessions client
Property Value | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
cancellationToken | System.Threading.CancellationToken The System.Threading.CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | DetectIntentRequest The request object containing all of the parameters for the API call. |
callSettings | Google.Api.Gax.Grpc.CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | DetectIntentRequest The request object containing all of the parameters for the API call. |
callSettings | Google.Api.Gax.Grpc.CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | DetectIntentRequest The request object containing all of the parameters for the API call. |
cancellationToken | System.Threading.CancellationToken A System.Threading.CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | FulfillIntentRequest The request object containing all of the parameters for the API call. |
callSettings | Google.Api.Gax.Grpc.CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | FulfillIntentRequest The request object containing all of the parameters for the API call. |
callSettings | Google.Api.Gax.Grpc.CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | FulfillIntentRequest The request object containing all of the parameters for the API call. |
cancellationToken | System.Threading.CancellationToken A System.Threading.CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | MatchIntentRequest The request object containing all of the parameters for the API call. |
callSettings | Google.Api.Gax.Grpc.CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | MatchIntentRequest The request object containing all of the parameters for the API call. |
callSettings | Google.Api.Gax.Grpc.CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | MatchIntentRequest The request object containing all of the parameters for the API call. |
cancellationToken | System.Threading.CancellationToken A System.Threading.CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
System.Threading.Tasks.Task | A task representing the asynchronous shutdown operation. |
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 | |
---|---|
Name | Description |
callSettings | Google.Api.Gax.Grpc.CallSettings If not null, applies overrides to this RPC call. |
streamingSettings | Google.Api.Gax.Grpc.BidirectionalStreamingSettings If not null, applies streaming overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
SessionsClient.StreamingDetectIntentStream | The client-server stream. |