Discovery Engine v1beta API - Class CompletionServiceClient (1.0.0-beta07)

public abstract class CompletionServiceClient

Reference documentation and code samples for the Discovery Engine v1beta API class CompletionServiceClient.

CompletionService client wrapper, for convenient use.

Inheritance

object > CompletionServiceClient

Namespace

Google.Cloud.DiscoveryEngine.V1Beta

Assembly

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
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default CompletionService scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default CompletionService scopes are:

GrpcClient

public virtual CompletionService.CompletionServiceClient GrpcClient { get; }

The underlying gRPC CompletionService client

Property Value
TypeDescription
CompletionServiceCompletionServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

CompleteQuery(CompleteQueryRequest, CallSettings)

public virtual CompleteQueryResponse CompleteQuery(CompleteQueryRequest request, CallSettings callSettings = null)

Completes the specified user input with keyword suggestions.

Parameters
NameDescription
requestCompleteQueryRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
CompleteQueryResponse

The RPC response.

Example
// Create client
CompletionServiceClient completionServiceClient = CompletionServiceClient.Create();
// Initialize request argument(s)
CompleteQueryRequest request = new CompleteQueryRequest
{
    DataStoreAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
    Query = "",
    QueryModel = "",
    UserPseudoId = "",
    IncludeTailSuggestions = false,
};
// 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
NameDescription
requestCompleteQueryRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskCompleteQueryResponse

A Task containing the RPC response.

Example
// 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 = "",
    IncludeTailSuggestions = false,
};
// 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
NameDescription
requestCompleteQueryRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskCompleteQueryResponse

A Task containing the RPC response.

Example
// 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 = "",
    IncludeTailSuggestions = false,
};
// 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
TypeDescription
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
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
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
TypeDescription
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.