Cloud AI Platform v1beta1 API - Class VertexRagServiceClient (1.0.0-beta02)

public abstract class VertexRagServiceClient

Reference documentation and code samples for the Cloud AI Platform v1beta1 API class VertexRagServiceClient.

VertexRagService client wrapper, for convenient use.

Inheritance

object > VertexRagServiceClient

Namespace

Google.Cloud.AIPlatform.V1Beta1

Assembly

Google.Cloud.AIPlatform.V1Beta1.dll

Remarks

A service for retrieving relevant contexts.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default VertexRagService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default VertexRagService scopes are:

GrpcClient

public virtual VertexRagService.VertexRagServiceClient GrpcClient { get; }

The underlying gRPC VertexRagService client

Property Value
Type Description
VertexRagServiceVertexRagServiceClient

IAMPolicyClient

public virtual IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
Type Description
IAMPolicyClient

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

Create()

public static VertexRagServiceClient Create()

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

Returns
Type Description
VertexRagServiceClient

The created VertexRagServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskVertexRagServiceClient

The task representing the created VertexRagServiceClient.

RetrieveContexts(LocationName, RagQuery, CallSettings)

public virtual RetrieveContextsResponse RetrieveContexts(LocationName parent, RagQuery query, CallSettings callSettings = null)

Retrieves relevant contexts for a query.

Parameters
Name Description
parent LocationName

Required. The resource name of the Location from which to retrieve RagContexts. The users must have permission to make a call in the project. Format: projects/{project}/locations/{location}.

query RagQuery

Required. Single RAG retrieve query.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RetrieveContextsResponse

The RPC response.

Example
// Create client
VertexRagServiceClient vertexRagServiceClient = VertexRagServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
RagQuery query = new RagQuery();
// Make the request
RetrieveContextsResponse response = vertexRagServiceClient.RetrieveContexts(parent, query);

RetrieveContexts(RetrieveContextsRequest, CallSettings)

public virtual RetrieveContextsResponse RetrieveContexts(RetrieveContextsRequest request, CallSettings callSettings = null)

Retrieves relevant contexts for a query.

Parameters
Name Description
request RetrieveContextsRequest

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
RetrieveContextsResponse

The RPC response.

Example
// Create client
VertexRagServiceClient vertexRagServiceClient = VertexRagServiceClient.Create();
// Initialize request argument(s)
RetrieveContextsRequest request = new RetrieveContextsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    VertexRagStore = new RetrieveContextsRequest.Types.VertexRagStore(),
    Query = new RagQuery(),
};
// Make the request
RetrieveContextsResponse response = vertexRagServiceClient.RetrieveContexts(request);

RetrieveContexts(string, RagQuery, CallSettings)

public virtual RetrieveContextsResponse RetrieveContexts(string parent, RagQuery query, CallSettings callSettings = null)

Retrieves relevant contexts for a query.

Parameters
Name Description
parent string

Required. The resource name of the Location from which to retrieve RagContexts. The users must have permission to make a call in the project. Format: projects/{project}/locations/{location}.

query RagQuery

Required. Single RAG retrieve query.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RetrieveContextsResponse

The RPC response.

Example
// Create client
VertexRagServiceClient vertexRagServiceClient = VertexRagServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
RagQuery query = new RagQuery();
// Make the request
RetrieveContextsResponse response = vertexRagServiceClient.RetrieveContexts(parent, query);

RetrieveContextsAsync(LocationName, RagQuery, CallSettings)

public virtual Task<RetrieveContextsResponse> RetrieveContextsAsync(LocationName parent, RagQuery query, CallSettings callSettings = null)

Retrieves relevant contexts for a query.

Parameters
Name Description
parent LocationName

Required. The resource name of the Location from which to retrieve RagContexts. The users must have permission to make a call in the project. Format: projects/{project}/locations/{location}.

query RagQuery

Required. Single RAG retrieve query.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskRetrieveContextsResponse

A Task containing the RPC response.

Example
// Create client
VertexRagServiceClient vertexRagServiceClient = await VertexRagServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
RagQuery query = new RagQuery();
// Make the request
RetrieveContextsResponse response = await vertexRagServiceClient.RetrieveContextsAsync(parent, query);

RetrieveContextsAsync(LocationName, RagQuery, CancellationToken)

public virtual Task<RetrieveContextsResponse> RetrieveContextsAsync(LocationName parent, RagQuery query, CancellationToken cancellationToken)

Retrieves relevant contexts for a query.

Parameters
Name Description
parent LocationName

Required. The resource name of the Location from which to retrieve RagContexts. The users must have permission to make a call in the project. Format: projects/{project}/locations/{location}.

query RagQuery

Required. Single RAG retrieve query.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskRetrieveContextsResponse

A Task containing the RPC response.

Example
// Create client
VertexRagServiceClient vertexRagServiceClient = await VertexRagServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
RagQuery query = new RagQuery();
// Make the request
RetrieveContextsResponse response = await vertexRagServiceClient.RetrieveContextsAsync(parent, query);

RetrieveContextsAsync(RetrieveContextsRequest, CallSettings)

public virtual Task<RetrieveContextsResponse> RetrieveContextsAsync(RetrieveContextsRequest request, CallSettings callSettings = null)

Retrieves relevant contexts for a query.

Parameters
Name Description
request RetrieveContextsRequest

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
TaskRetrieveContextsResponse

A Task containing the RPC response.

Example
// Create client
VertexRagServiceClient vertexRagServiceClient = await VertexRagServiceClient.CreateAsync();
// Initialize request argument(s)
RetrieveContextsRequest request = new RetrieveContextsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    VertexRagStore = new RetrieveContextsRequest.Types.VertexRagStore(),
    Query = new RagQuery(),
};
// Make the request
RetrieveContextsResponse response = await vertexRagServiceClient.RetrieveContextsAsync(request);

RetrieveContextsAsync(RetrieveContextsRequest, CancellationToken)

public virtual Task<RetrieveContextsResponse> RetrieveContextsAsync(RetrieveContextsRequest request, CancellationToken cancellationToken)

Retrieves relevant contexts for a query.

Parameters
Name Description
request RetrieveContextsRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskRetrieveContextsResponse

A Task containing the RPC response.

Example
// Create client
VertexRagServiceClient vertexRagServiceClient = await VertexRagServiceClient.CreateAsync();
// Initialize request argument(s)
RetrieveContextsRequest request = new RetrieveContextsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    VertexRagStore = new RetrieveContextsRequest.Types.VertexRagStore(),
    Query = new RagQuery(),
};
// Make the request
RetrieveContextsResponse response = await vertexRagServiceClient.RetrieveContextsAsync(request);

RetrieveContextsAsync(string, RagQuery, CallSettings)

public virtual Task<RetrieveContextsResponse> RetrieveContextsAsync(string parent, RagQuery query, CallSettings callSettings = null)

Retrieves relevant contexts for a query.

Parameters
Name Description
parent string

Required. The resource name of the Location from which to retrieve RagContexts. The users must have permission to make a call in the project. Format: projects/{project}/locations/{location}.

query RagQuery

Required. Single RAG retrieve query.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskRetrieveContextsResponse

A Task containing the RPC response.

Example
// Create client
VertexRagServiceClient vertexRagServiceClient = await VertexRagServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
RagQuery query = new RagQuery();
// Make the request
RetrieveContextsResponse response = await vertexRagServiceClient.RetrieveContextsAsync(parent, query);

RetrieveContextsAsync(string, RagQuery, CancellationToken)

public virtual Task<RetrieveContextsResponse> RetrieveContextsAsync(string parent, RagQuery query, CancellationToken cancellationToken)

Retrieves relevant contexts for a query.

Parameters
Name Description
parent string

Required. The resource name of the Location from which to retrieve RagContexts. The users must have permission to make a call in the project. Format: projects/{project}/locations/{location}.

query RagQuery

Required. Single RAG retrieve query.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskRetrieveContextsResponse

A Task containing the RPC response.

Example
// Create client
VertexRagServiceClient vertexRagServiceClient = await VertexRagServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
RagQuery query = new RagQuery();
// Make the request
RetrieveContextsResponse response = await vertexRagServiceClient.RetrieveContextsAsync(parent, query);

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.