Imports a file from the temporary storage space of Alibaba Cloud Model Studio into a data connection (formerly known as application data).
Operation description
-
To call this API, a RAM user (sub-account) must have the required API permissions for Alibaba Cloud Model Studio and be added to a workspace. The required policy is
AliyunBailianDataFullAccess, which includes thesfm:AddFilepermission. An Alibaba Cloud account (primary account) can call this API directly without authorization. We recommend using the latest Alibaba Cloud Model Studio SDK to call this API. -
This API is not idempotent.
Throttling: Frequent calls to this API are subject to throttling. Do not exceed a rate of 10 calls per second. If your request is throttled, try again later.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sfm:AddFile |
create |
*All Resource
|
None | None |
Request syntax
PUT /{WorkspaceId}/datacenter/file HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| WorkspaceId |
string |
Yes |
The ID of the workspace where you want to upload the file. For information about how to obtain the workspace ID, see How to use workspaces. |
llm-3shx2gu255oqxxxx |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| LeaseId |
string |
Yes |
The upload lease ID. This value maps to the |
68abd1dea7b6404d8f7d7b9f7fbd332d.17166xxxxxxxx |
| Parser |
string |
Yes |
The type of parser. Valid values:
Note If CategoryType is set to UNSTRUCTURED, the parser parses your uploaded file based on the category’s data parsing settings.Note If CategoryType is set to SESSION_FILE, the system uses a default parsing method that cannot be changed. |
AUTO_SELECT |
| CategoryId |
string |
Yes |
|
cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx |
| Tags |
array |
No |
|
|
|
string |
No |
A tag for the file. Each tag can be up to 32 characters long and can contain Unicode letters (including English letters, Chinese characters, and digits), underscores (_), and hyphens (-). |
产品介绍 |
|
| CategoryType |
string |
No |
The type of category. This parameter is optional. Default value:
|
UNSTRUCTURED |
| OriginalFileUrl |
string |
No |
The URL of the file. The system records this link when building a document retrieval-based knowledge base. When you interact with an agent in the Alibaba Cloud Model Studio console, this URL is returned with the retrieval results for the file in the Note
For this parameter to take effect, the knowledge base feature must be enabled for the agent, and the display the source of the answer option must be enabled. |
www.test.com/111.docx |
| ParserConfig |
object |
No |
The parser configuration. This parameter is required only if you set |
|
| ModelName |
string |
No |
The model name. |
qwen-vl-max |
| ModelPrompt |
string |
No |
The prompt to use when calling the Qwen-VL parser. |
#角色 你是一个专业的图片内容标注人员,擅长识别并描述出图片中的内容。 # 任务目标 请结合输入图片,详细描述图片中的内容。 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| Code |
string |
The error code. |
DataCenter.FileTooLarge |
| Data |
object |
The data returned for the request. |
|
| FileId |
string |
The ID of the file. Save this ID for use in subsequent API calls involving this file. |
file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx |
| Parser |
string |
The parser that was used for the file. A possible value is:
|
DASHSCOPE_DOCMIND |
| Message |
string |
The error message. |
User not authorized to operate on the specified resource. |
| RequestId |
string |
The request ID. |
778C0B3B-xxxx-5FC1-A947-36EDD13606AB |
| Status |
string |
The status code of the request. |
200 |
| Success |
string |
Indicates whether the API call was successful. Valid values:
|
true |
Examples
Success response
JSON format
{
"Code": "DataCenter.FileTooLarge",
"Data": {
"FileId": "file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx",
"Parser": "DASHSCOPE_DOCMIND"
},
"Message": "User not authorized to operate on the specified resource.",
"RequestId": "778C0B3B-xxxx-5FC1-A947-36EDD13606AB",
"Status": "200",
"Success": "true"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.