Skip to main content

rag_files

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

Overview

Namerag_files
TypeResource
Idgoogle.aiplatform.rag_files

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the RagFile.
createTimestring (google-datetime)Output only. Timestamp when this RagFile was created.
descriptionstringOptional. The description of the RagFile.
directUploadSourceobjectOutput only. The RagFile is encapsulated and uploaded in the UploadRagFile request. (id: GoogleCloudAiplatformV1DirectUploadSource)
displayNamestringRequired. The display name of the RagFile. The name can be up to 128 characters long and can consist of any UTF-8 characters.
fileStatusobjectOutput only. State of the RagFile. (id: GoogleCloudAiplatformV1FileStatus)
gcsSourceobjectOutput only. Google Cloud Storage location of the RagFile. It does not support wildcards in the Cloud Storage uri for now. (id: GoogleCloudAiplatformV1GcsSource)
googleDriveSourceobjectOutput only. Google Drive location. Supports importing individual files as well as Google Drive folders. (id: GoogleCloudAiplatformV1GoogleDriveSource)
jiraSourceobjectThe RagFile is imported from a Jira query. (id: GoogleCloudAiplatformV1JiraSource)
sharePointSourcesobjectThe RagFile is imported from a SharePoint source. (id: GoogleCloudAiplatformV1SharePointSources)
slackSourceobjectThe RagFile is imported from a Slack channel. (id: GoogleCloudAiplatformV1SlackSource)
updateTimestring (google-datetime)Output only. Timestamp when this RagFile was last updated.
userMetadatastringOutput only. The metadata for metadata search. The user_metadata Needs to be in JSON format.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, ragCorporaId, ragFilesIdGets a RagFile.
listselectprojectsId, locationsId, ragCorporaIdpageSize, pageTokenLists RagFiles in a RagCorpus.
deletedeleteprojectsId, locationsId, ragCorporaId, ragFilesIdforceDeleteDeletes a RagFile.
importexecprojectsId, locationsId, ragCorporaIdImport files from Google Cloud Storage or Google Drive into a RagCorpus.
uploadexecprojectsId, locationsId, ragCorporaIdUpload a file into 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
ragFilesIdstring
forceDeleteboolean
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets a RagFile.

SELECT
name,
createTime,
description,
directUploadSource,
displayName,
fileStatus,
gcsSource,
googleDriveSource,
jiraSource,
sharePointSources,
slackSource,
updateTime,
userMetadata
FROM google.aiplatform.rag_files
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND ragCorporaId = '{{ ragCorporaId }}' -- required
AND ragFilesId = '{{ ragFilesId }}' -- required;

DELETE examples

Deletes a RagFile.

DELETE FROM google.aiplatform.rag_files
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND ragCorporaId = '{{ ragCorporaId }}' --required
AND ragFilesId = '{{ ragFilesId }}' --required
AND forceDelete = '{{ forceDelete }}';

Lifecycle Methods

Import files from Google Cloud Storage or Google Drive into a RagCorpus.

EXEC google.aiplatform.rag_files.import 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@ragCorporaId='{{ ragCorporaId }}' --required
@@json=
'{
"importRagFilesConfig": "{{ importRagFilesConfig }}"
}';