public abstract class CompletionServiceClient
Reference documentation and code samples for the Discovery Engine v1beta API class CompletionServiceClient.
CompletionService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.DiscoveryEngine.V1BetaAssembly
Google.Cloud.DiscoveryEngine.V1Beta.dll
Remarks
Service for Auto-Completion.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the CompletionService service, which is a host of "discoveryengine.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default CompletionService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default CompletionService scopes are:
GrpcClient
public virtual CompletionService.CompletionServiceClient GrpcClient { get; }
The underlying gRPC CompletionService client
Property Value | |
---|---|
Type | Description |
CompletionServiceCompletionServiceClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
Methods
CompleteQuery(CompleteQueryRequest, CallSettings)
public virtual CompleteQueryResponse CompleteQuery(CompleteQueryRequest request, CallSettings callSettings = null)
Completes the specified user input with keyword suggestions.
Parameters | |
---|---|
Name | Description |
request | CompleteQueryRequest 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 |
CompleteQueryResponse | The RPC response. |
// Create client
CompletionServiceClient completionServiceClient = CompletionServiceClient.Create();
// Initialize request argument(s)
CompleteQueryRequest request = new CompleteQueryRequest
{
DataStoreAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
Query = "",
QueryModel = "",
UserPseudoId = "",
};
// Make the request
CompleteQueryResponse response = completionServiceClient.CompleteQuery(request);
CompleteQueryAsync(CompleteQueryRequest, CallSettings)
public virtual Task<CompleteQueryResponse> CompleteQueryAsync(CompleteQueryRequest request, CallSettings callSettings = null)
Completes the specified user input with keyword suggestions.
Parameters | |
---|---|
Name | Description |
request | CompleteQueryRequest 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 |
TaskCompleteQueryResponse | A Task containing the RPC response. |
// Create client
CompletionServiceClient completionServiceClient = await CompletionServiceClient.CreateAsync();
// Initialize request argument(s)
CompleteQueryRequest request = new CompleteQueryRequest
{
DataStoreAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
Query = "",
QueryModel = "",
UserPseudoId = "",
};
// Make the request
CompleteQueryResponse response = await completionServiceClient.CompleteQueryAsync(request);
CompleteQueryAsync(CompleteQueryRequest, CancellationToken)
public virtual Task<CompleteQueryResponse> CompleteQueryAsync(CompleteQueryRequest request, CancellationToken cancellationToken)
Completes the specified user input with keyword suggestions.
Parameters | |
---|---|
Name | Description |
request | CompleteQueryRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskCompleteQueryResponse | A Task containing the RPC response. |
// Create client
CompletionServiceClient completionServiceClient = await CompletionServiceClient.CreateAsync();
// Initialize request argument(s)
CompleteQueryRequest request = new CompleteQueryRequest
{
DataStoreAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
Query = "",
QueryModel = "",
UserPseudoId = "",
};
// Make the request
CompleteQueryResponse response = await completionServiceClient.CompleteQueryAsync(request);
Create()
public static CompletionServiceClient Create()
Synchronously creates a CompletionServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CompletionServiceClientBuilder.
Returns | |
---|---|
Type | Description |
CompletionServiceClient | The created CompletionServiceClient. |
CreateAsync(CancellationToken)
public static Task<CompletionServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a CompletionServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CompletionServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskCompletionServiceClient | The task representing the created CompletionServiceClient. |
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. |
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.