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
platformIPlatformAdapterThe platform adapter for API communication.
httpClientHttpClientOptional HTTP client for API requests.
loggerILoggerOptional logger for diagnostic output.
Methods
CreateRagCorpusAsync(RagCorpus, CancellationToken)
Creates a new RagCorpus resource.
public Task<GoogleLongRunningOperation?> CreateRagCorpusAsync(RagCorpus ragCorpus, CancellationToken cancellationToken = default)
Parameters
ragCorpusRagCorpusThe RagCorpus to create.
cancellationTokenCancellationTokenThe 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
namestringThe resource name of the RagCorpus to delete.
cancellationTokenCancellationTokenThe 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
namestringThe resource name of the RagCorpus.
cancellationTokenCancellationTokenThe cancellation token to cancel the operation.
Returns
- 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
cancellationTokenCancellationTokenThe 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
pageSizeint?The maximum number of RagCorpus resources to return.
pageTokenstringA page token, received from a previous ListRagCorporaAsync(int?, string?, CancellationToken) call.
cancellationTokenCancellationTokenThe 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
corpusNamestringThe resource name of the RagCorpus to update.
ragCorpusRagCorpusThe RagCorpus resource to update.
updateMaskstringThe list of fields to update.
cancellationTokenCancellationTokenThe 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
configRagEngineConfigThe new configuration. Name may be left empty.
cancellationTokenCancellationTokenThe 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