Table of Contents

Class RagCorpusClient

Namespace
GenerativeAI.Types.RagEngine
Assembly
GenerativeAI.dll

A client for interacting with the Vertex AI RAG Engine API.

public class RagCorpusClient : BaseClient
Inheritance
RagCorpusClient
Inherited Members
Extension Methods

Constructors

RagCorpusClient(IPlatformAdapter, HttpClient?, ILogger?)

Initializes a new instance of the RagCorpusClient class.

public RagCorpusClient(IPlatformAdapter platform, HttpClient? httpClient = null, ILogger? logger = null)

Parameters

platform IPlatformAdapter

The platform adapter for API communication.

httpClient HttpClient

Optional HTTP client for API requests.

logger ILogger

Optional logger for diagnostic output.

Methods

CreateRagCorpusAsync(RagCorpus, CancellationToken)

Creates a new RagCorpus resource.

public Task<GoogleLongRunningOperation?> CreateRagCorpusAsync(RagCorpus ragCorpus, CancellationToken cancellationToken = default)

Parameters

ragCorpus RagCorpus

The RagCorpus to create.

cancellationToken CancellationToken

The cancellation token to cancel the operation.

Returns

Task<GoogleLongRunningOperation>

The created RagCorpus.

See Also

DeleteRagCorpusAsync(string, CancellationToken)

Deletes a RagCorpus resource.

public Task DeleteRagCorpusAsync(string name, CancellationToken cancellationToken = default)

Parameters

name string

The resource name of the RagCorpus to delete.

cancellationToken CancellationToken

The cancellation token to cancel the operation.

Returns

Task

A task representing the asynchronous operation.

See Also

GetRagCorpusAsync(string, CancellationToken)

Gets a specific RagCorpus resource.

public Task<RagCorpus?> GetRagCorpusAsync(string name, CancellationToken cancellationToken = default)

Parameters

name string

The resource name of the RagCorpus.

cancellationToken CancellationToken

The cancellation token to cancel the operation.

Returns

Task<RagCorpus>

The RagCorpus resource.

See Also

GetRagEngineConfigAsync(CancellationToken)

Gets the RAG Engine configuration (for example Serverless or Spanner mode) for the platform's location.

public Task<RagEngineConfig?> GetRagEngineConfigAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token to cancel the operation.

Returns

Task<RagEngineConfig>

The current RagEngineConfig.

See Also

ListRagCorporaAsync(int?, string?, CancellationToken)

Lists available RagCorpus resources.

public Task<ListRagCorporaResponse?> ListRagCorporaAsync(int? pageSize = null, string? pageToken = null, CancellationToken cancellationToken = default)

Parameters

pageSize int?

The maximum number of RagCorpus resources to return.

pageToken string

A page token, received from a previous ListRagCorporaAsync(int?, string?, CancellationToken) call.

cancellationToken CancellationToken

The cancellation token to cancel the operation.

Returns

Task<ListRagCorporaResponse>

A list of RagCorpus resources.

See Also

UpdateRagCorpusAsync(string, RagCorpus, string?, CancellationToken)

Updates a RagCorpus resource.

public Task<GoogleLongRunningOperation?> UpdateRagCorpusAsync(string corpusName, RagCorpus ragCorpus, string? updateMask = null, CancellationToken cancellationToken = default)

Parameters

corpusName string

The resource name of the RagCorpus to update.

ragCorpus RagCorpus

The RagCorpus resource to update.

updateMask string

The list of fields to update.

cancellationToken CancellationToken

The cancellation token to cancel the operation.

Returns

Task<GoogleLongRunningOperation>

The updated RagCorpus resource.

See Also

UpdateRagEngineConfigAsync(RagEngineConfig, CancellationToken)

Updates the RAG Engine configuration for the platform's location, for example to switch between Serverless and Spanner mode.

public Task<GoogleLongRunningOperation?> UpdateRagEngineConfigAsync(RagEngineConfig config, CancellationToken cancellationToken = default)

Parameters

config RagEngineConfig

The new configuration. Name may be left empty.

cancellationToken CancellationToken

The cancellation token to cancel the operation.

Returns

Task<GoogleLongRunningOperation>

The long-running operation that applies the change.

Remarks

Choosing Unprovisioned disables the RAG Engine and permanently deletes its data.

See Also

See Also