Method: media.upload

Upload a file into a RagCorpus.

HTTP request

  • Upload URI, for media upload requests:
    POST https://{service-endpoint}/upload/v1beta1/{parent}/ragFiles:upload
  • Metadata URI, for metadata-only requests:
    POST https://{service-endpoint}/v1beta1/{parent}/ragFiles:upload

Where {service-endpoint} is one of the supported service endpoints.

Path parameters

Parameters
parent

string

Required. The name of the RagCorpus resource into which to upload the file. Format: projects/{project}/locations/{location}/ragCorpora/{ragCorpus}

Request body

The request body contains data with the following structure:

JSON representation
{
  "ragFile": {
    object (RagFile)
  },
  "uploadRagFileConfig": {
    object (UploadRagFileConfig)
  }
}
Fields
ragFile

object (RagFile)

Required. The RagFile to upload.

uploadRagFileConfig

object (UploadRagFileConfig)

Required. The config for the RagFiles to be uploaded into the RagCorpus. VertexRagDataService.UploadRagFile.

Response body

Response message for VertexRagDataService.UploadRagFile.

If successful, the response body contains data with the following structure:

JSON representation
{

  // Union field result can be only one of the following:
  "ragFile": {
    object (RagFile)
  },
  "error": {
    object (Status)
  }
  // End of list of possible types for union field result.
}
Fields

Union field result.

result can be only one of the following:

ragFile

object (RagFile)

The RagFile that had been uploaded into the RagCorpus.

error

object (Status)

The error that occurred while processing the RagFile.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UploadRagFileConfig

Config for uploading RagFile.

JSON representation
{
  "ragFileChunkingConfig": {
    object (RagFileChunkingConfig)
  }
}
Fields
ragFileChunkingConfig

object (RagFileChunkingConfig)

Specifies the size and overlap of chunks after uploading RagFile.