rag_files
Creates, updates, deletes, gets or lists a rag_files
resource.
Overview
Name | rag_files |
Type | Resource |
Id | google.aiplatform.rag_files |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. The resource name of the RagFile. |
createTime | string (google-datetime) | Output only. Timestamp when this RagFile was created. |
description | string | Optional. The description of the RagFile. |
directUploadSource | object | Output only. The RagFile is encapsulated and uploaded in the UploadRagFile request. (id: GoogleCloudAiplatformV1DirectUploadSource) |
displayName | string | Required. The display name of the RagFile. The name can be up to 128 characters long and can consist of any UTF-8 characters. |
fileStatus | object | Output only. State of the RagFile. (id: GoogleCloudAiplatformV1FileStatus) |
gcsSource | object | Output only. Google Cloud Storage location of the RagFile. It does not support wildcards in the Cloud Storage uri for now. (id: GoogleCloudAiplatformV1GcsSource) |
googleDriveSource | object | Output only. Google Drive location. Supports importing individual files as well as Google Drive folders. (id: GoogleCloudAiplatformV1GoogleDriveSource) |
jiraSource | object | The RagFile is imported from a Jira query. (id: GoogleCloudAiplatformV1JiraSource) |
sharePointSources | object | The RagFile is imported from a SharePoint source. (id: GoogleCloudAiplatformV1SharePointSources) |
slackSource | object | The RagFile is imported from a Slack channel. (id: GoogleCloudAiplatformV1SlackSource) |
updateTime | string (google-datetime) | Output only. Timestamp when this RagFile was last updated. |
userMetadata | string | Output only. The metadata for metadata search. The user_metadata Needs to be in JSON format. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. The resource name of the RagFile. |
createTime | string (google-datetime) | Output only. Timestamp when this RagFile was created. |
description | string | Optional. The description of the RagFile. |
directUploadSource | object | Output only. The RagFile is encapsulated and uploaded in the UploadRagFile request. (id: GoogleCloudAiplatformV1DirectUploadSource) |
displayName | string | Required. The display name of the RagFile. The name can be up to 128 characters long and can consist of any UTF-8 characters. |
fileStatus | object | Output only. State of the RagFile. (id: GoogleCloudAiplatformV1FileStatus) |
gcsSource | object | Output only. Google Cloud Storage location of the RagFile. It does not support wildcards in the Cloud Storage uri for now. (id: GoogleCloudAiplatformV1GcsSource) |
googleDriveSource | object | Output only. Google Drive location. Supports importing individual files as well as Google Drive folders. (id: GoogleCloudAiplatformV1GoogleDriveSource) |
jiraSource | object | The RagFile is imported from a Jira query. (id: GoogleCloudAiplatformV1JiraSource) |
sharePointSources | object | The RagFile is imported from a SharePoint source. (id: GoogleCloudAiplatformV1SharePointSources) |
slackSource | object | The RagFile is imported from a Slack channel. (id: GoogleCloudAiplatformV1SlackSource) |
updateTime | string (google-datetime) | Output only. Timestamp when this RagFile was last updated. |
userMetadata | string | Output only. The metadata for metadata search. The user_metadata Needs to be in JSON format. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , ragCorporaId , ragFilesId | Gets a RagFile. | |
list | select | projectsId , locationsId , ragCorporaId | pageSize , pageToken | Lists RagFiles in a RagCorpus. |
delete | delete | projectsId , locationsId , ragCorporaId , ragFilesId | forceDelete | Deletes a RagFile. |
import | exec | projectsId , locationsId , ragCorporaId | Import files from Google Cloud Storage or Google Drive into a RagCorpus. | |
upload | exec | projectsId , locationsId , ragCorporaId | Upload 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.
Name | Datatype | Description |
---|---|---|
locationsId | string | |
projectsId | string | |
ragCorporaId | string | |
ragFilesId | string | |
forceDelete | boolean | |
pageSize | integer (int32) | |
pageToken | string |
SELECT
examples
- get
- list
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;
Lists RagFiles in a RagCorpus.
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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
DELETE
examples
- delete
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
- upload
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 }}"
}';
Upload a file into a RagCorpus.
EXEC google.aiplatform.rag_files.upload
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@ragCorporaId='{{ ragCorporaId }}' --required
@@json=
'{
"ragFile": "{{ ragFile }}",
"uploadRagFileConfig": "{{ uploadRagFileConfig }}"
}';