Imports a file from the temporary storage of Alibaba Cloud Model Studio into an Alibaba Cloud Model Studio data connection (formerly known as application data).
Operation description
- Resource Access Management (RAM) users must first obtain API permissions for Alibaba Cloud Model Studio (requires
AliyunBailianDataFullAccess, which includes the sfm:AddFile permission), and join a workspace before invoking this operation. Alibaba Cloud accounts can invoke this operation directly without authorization. Invoke this operation by using the latest Alibaba Cloud Model Studio SDK. - This operation is not idempotent.
Try it now
Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.
Test
RAM authorization
The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:
-
Action: The actions can be used in the
Actionelement of RAM permission policy statements to grant permissions to perform the operation. - API: The API that you can call to perform the action.
- Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.
-
Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.
- For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the
Resourceelement of the policy. - For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the
Resourceelement of the policy.
- For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the
- Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.
- Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.
Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
sfm:AddFile | create | *All Resource
| None | None |
Request syntax
Path Parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The workspace ID. The file is uploaded to this workspace. For information about how to obtain the workspace ID, see How to use a workspace. | llm-3shx2gu255oqxxxx |
Request parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| LeaseId | string | Yes | The upload lease ID, which corresponds to the | 68abd1dea7b6404d8f7d7b9f7fbd332d.17166xxxxxxxx |
| Parser | string | Yes | The parser type. Valid values:
The uploaded file is parsed by using the currently specified parser. If you set this parameter to AUTO_SELECT, the parser configured for the category is used. | AUTO_SELECT |
| CategoryId | string | Yes | Set this parameter to the category ID of the uploaded file, which is the | cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx |
| Tags | array | No |
| |
string | No | The tag of the file. Each tag can contain up to 32 characters. The tag supports characters in the Unicode letter category (including English letters, Chinese characters, and digits), underscores (_), and hyphens (-). | 产品介绍 | |
| CategoryType | string | No | The category type. This parameter is optional. Default value: UNSTRUCTURED. Valid values:
| UNSTRUCTURED |
| OriginalFileUrl | string | No | Specifies a URL for the file. The system records this URL when building a document search knowledge base. When you use the Alibaba Cloud Model Studio console to interact with an agent application, this URL is returned with the retrieval results of the file through the The agent application must have Knowledge Base enabled and the Show answer sources feature turned on. Otherwise, this parameter does not take effect. | |
| ParserConfig | object | No | The parser configuration. This parameter is required only when the parser type is set to Qwen VL parsing. | |
| ModelName | string | No | The model name. | qwen-vl-max |
| ModelPrompt | string | No | The prompt used when calling Qwen VL parsing. | #角色 你是一个专业的图片内容标注人员,擅长识别并描述出图片中的内容。 # 任务目标 请结合输入图片,详细描述图片中的内容。 |
Response elements
Element | Type | Description | Example |
|---|---|---|---|
object | Schema of Response | ||
| Code | string | The error code. | DataCenter.FileTooLarge |
| Data | object | The data field returned by the operation. | |
| FileId | string | The file ID. Keep this value safe because it is used in all subsequent API operations related to this file. | file_9a65732555b54d5ea10796ca5742ba22_xxxxxxxx |
| Parser | string | The parser type used to parse the file. Valid values:
| 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 returned by the operation. | 200 |
| Success | string | Indicates whether the call was successful. Valid values:
| true |
Examples
Success response
JSON format