Skip to main content

rag_corpora

Creates, updates, deletes, gets or lists a rag_corpora resource.

Overview

Namerag_corpora
TypeResource
Idgoogle.aiplatform.rag_corpora

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the RagCorpus.
corpusStatusobjectOutput only. RagCorpus state. (id: GoogleCloudAiplatformV1CorpusStatus)
createTimestring (google-datetime)Output only. Timestamp when this RagCorpus was created.
descriptionstringOptional. The description of the RagCorpus.
displayNamestringRequired. The display name of the RagCorpus. The name can be up to 128 characters long and can consist of any UTF-8 characters.
encryptionSpecobjectOptional. Immutable. The CMEK key name used to encrypt at-rest data related to this Corpus. Only applicable to RagManagedDb option for Vector DB. This field can only be set at corpus creation time, and cannot be updated or deleted. (id: GoogleCloudAiplatformV1EncryptionSpec)
updateTimestring (google-datetime)Output only. Timestamp when this RagCorpus was last updated.
vectorDbConfigobjectOptional. Immutable. The config for the Vector DBs. (id: GoogleCloudAiplatformV1RagVectorDbConfig)
vertexAiSearchConfigobjectOptional. Immutable. The config for the Vertex AI Search. (id: GoogleCloudAiplatformV1VertexAiSearchConfig)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, ragCorporaIdGets a RagCorpus.
listselectprojectsId, locationsIdpageSize, pageTokenLists RagCorpora in a Location.
createinsertprojectsId, locationsIdCreates a RagCorpus.
patchupdateprojectsId, locationsId, ragCorporaIdUpdates a RagCorpus.
deletedeleteprojectsId, locationsId, ragCorporaIdforceDeletes a RagCorpus.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
projectsIdstring
ragCorporaIdstring
forceboolean
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets a RagCorpus.

SELECT
name,
corpusStatus,
createTime,
description,
displayName,
encryptionSpec,
updateTime,
vectorDbConfig,
vertexAiSearchConfig
FROM google.aiplatform.rag_corpora
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND ragCorporaId = '{{ ragCorporaId }}' -- required;

INSERT examples

Creates a RagCorpus.

INSERT INTO google.aiplatform.rag_corpora (
data__vectorDbConfig,
data__vertexAiSearchConfig,
data__displayName,
data__description,
data__encryptionSpec,
projectsId,
locationsId
)
SELECT
'{{ vectorDbConfig }}',
'{{ vertexAiSearchConfig }}',
'{{ displayName }}',
'{{ description }}',
'{{ encryptionSpec }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a RagCorpus.

UPDATE google.aiplatform.rag_corpora
SET
data__vectorDbConfig = '{{ vectorDbConfig }}',
data__vertexAiSearchConfig = '{{ vertexAiSearchConfig }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__encryptionSpec = '{{ encryptionSpec }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND ragCorporaId = '{{ ragCorporaId }}' --required
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a RagCorpus.

DELETE FROM google.aiplatform.rag_corpora
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND ragCorporaId = '{{ ragCorporaId }}' --required
AND force = '{{ force }}';