Uploads a document asynchronously to a specified document collection for vectorization and storage.
Operation description
The server loads and chunks a document based on the file extension, performs vectorization by using the embedding model that is specified when you call the CreateDocumentCollection operation, and then writes the document to the specified document collection. This operation supports multi-modal embedding for various formats of text and images.
Related operations:
-
You can call the GetUploadDocumentJob operation to query the progress and result of a document upload job.
-
You can call the CancelUploadDocumentJob operation to cancel a document upload job.
-
After a document upload request is submitted, the request is queued for processing. Up to 20 documents in the Pending and Running states can be processed within a Resource Access Management (RAM) user or Alibaba Cloud account.
-
A text document can be split into up to 100,000 chunks.
-
If a document collection uses the OnePeace model, each RAM user or Alibaba Cloud account can upload and query up to 10,000 images.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
gpdb:UploadDocumentAsync |
create |
*Document
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBInstanceId |
string |
Yes |
The ID of the instance that has vector engine optimization enabled. You can call the DescribeDBInstances operation to query instance IDs in the target region. |
gp-bp12ga6v69h86**** |
| Collection |
string |
Yes |
The name of the document library. Note
Created by the CreateDocumentCollection API. You can call the ListDocumentCollections API to view the document libraries that have already been created. |
document |
| Namespace |
string |
No |
The namespace. Default value: public. You can call CreateNamespace to create a namespace and ListNamespaces to view existing namespaces. |
mynamespace |
| NamespacePassword |
string |
Yes |
The password for the namespace. This value is specified when you call the CreateNamespace operation. |
testpassword |
| RegionId |
string |
Yes |
The region ID of the instance. |
cn-hangzhou |
| FileName |
string |
Yes |
The name of the file being uploaded. Note
|
mydoc.txt |
| FileUrl |
string |
Yes |
The URL of the publicly accessible document. Note
Note
|
https://xx/mydoc.txt |
| Metadata |
object |
No |
The metadata. The value of this parameter must be the same as the Metadata parameter that is specified when you call the CreateDocumentCollection operation. |
|
|
any |
No |
The metadata. The value of this parameter must be the same as the Metadata parameter that is specified when you call the CreateDocumentCollection operation. |
{"title":"mytitle","page":1} |
|
| ChunkSize |
integer |
No |
The size of each chunk when splitting a document. Maximum value: 2048. |
250 |
| ChunkOverlap |
integer |
No |
The number of overlapping tokens between consecutive chunks. The value cannot exceed the ChunkSize value. Note
This parameter is used to prevent context missing that may occur due to data truncation. For example, when you upload a long text, you can retain specific overlapped text content between consecutive chunks to better understand the context. |
50 |
| Separators |
array |
No |
The separators that are used to split large amounts of data. Note
|
|
|
string |
No |
The separator. |
. |
|
| DryRun |
boolean |
No |
Specifies whether to perform only document understanding and chunking, but not vectorization and storage. Default value: false. Note
You can set this parameter to true, check the chunking effect, and then perform optimization if needed. |
false |
| ZhTitleEnhance |
boolean |
No |
Specifies whether to enable title enhancement. Note
You can determine the title text, mark the text in the metadata, and then combine the text with the upper-level title to implement text enhancement. |
false |
| TextSplitterName |
string |
No |
The name of the separator. Valid values:
|
ChineseRecursiveTextSplitter |
| DocumentLoaderName |
string |
No |
The document loader for processing the file. If not specified, the system selects a loader based on the file extension. Valid values:
|
PyMuPDFLoader |
| VlEnhance |
boolean |
No |
Specifies whether to enable VL-enhanced content recognition for complex documents. Default value: false. Note
|
false |
| SplitterModel |
string |
No |
When DocumentLoaderName is set to ADBPGLoader and TextSplitterName is set to LLMSplitter, you can specify the splitting model. Default Value: qwen3-8b. Note
Supported splitting models: qwq-plus, qwq-plus-latest, qwen-max, qwen-max-latest, qwen-plus, qwen-plus-latest, qwen-turbo, qwen-turbo-latest, qwen3-235b-a22b, qwen3-32b,qwen3-30b-a3b, qwen3-14b, qwen3-8b, qwen3-4b, qwen3-1.7b, qwen3-0.6b, qwq-32b qwen2.5-14b-instruct-1m, qwen2.5-7b-instruct-1m, qwen2.5-72b-Instruct, qwen2.5-32b-Instruct, qwen2.5-14b-Instruct, qwen2.5-7b-Instruct, qwen2.5-3b-instruct, qwen2.5-1.5b-instruct, qwen2.5-0.5b-instruct. |
qwen3-8b |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
ABB39CC3-4488-4857-905D-2E4A051D0521 |
| Message |
string |
The returned message. |
success |
| Status |
string |
API execution status, with the following values:
|
success |
| JobId |
string |
The job ID. |
231460f8-75dc-405e-a669-0c5204887e91 |
Examples
Success response
JSON format
{
"RequestId": "ABB39CC3-4488-4857-905D-2E4A051D0521",
"Message": "success",
"Status": "success",
"JobId": "231460f8-75dc-405e-a669-0c5204887e91"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.