AddDatasetDocument
Adds a document to a data source.
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.
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 |
|---|---|---|---|---|
aimiaobi:AddDatasetDocument | create | *All Resource
| None | None |
Request syntax
POST HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The unique identifier of the Model Studio workspace. For more information, see Obtain a workspaceId. | llm-xx |
| DatasetId | integer | No | The unique identifier of the dataset. | 1 |
| DatasetName | string | No | The name of the dataset. | 数据集名称 |
| Document | object | Yes | The document. | |
| DocUuid | string | No | The unique system ID of the document. The system automatically generates this ID. You do not need to specify this parameter. | xxxx |
| Url | string | No | The URL of the article. The URL must be accessible over the public network. | http://xxx |
| Content | string | No | The content. | 正文 |
| Summary | string | No | The summary of the article. | 文章摘要 |
| Title | string | No | The title of the document. | 标题 |
| PubTime | string | No | The publishing time. | 2024-12-09 13:35:40 |
| SourceFrom | string | No | The source. | xxx媒体 |
| MultimodalIndexName | string | No | Deprecated. This parameter is not available. | xxxx |
| DisableHandleMultimodalMedia | boolean | No | Specifies whether to disable the indexing of multimodal data, such as images and videos, in the current record. The default value is true. | false |
| MultimodalMedias | array<object> | No | A list of multimodal data in the document.
| |
object | No | The multimodal data. | ||
| MediaId | string | No | The unique identifier of the multimodal data. The system automatically generates this ID. You do not need to specify this parameter. | xxxx |
| MediaType | string | No | The type of the multimodal data.
| image |
| FileUrl | string | No | The URL of the file. The URL must be accessible over the public network. | http://xxx |
| DocId | string | No | The unique business ID of the document. | xx |
| DocType | string | No | The type of the document.
| image |
| Extend1 | string | No | Extension field 1. | xxx |
| Extend2 | string | No | Extension field 2. | xxxx |
| Extend3 | string | No | Extension field 3. | xxx |
| Metadata | object | No | The metadata. | |
| VideoShots | array<object> | No | The video shot information. | |
object | No | The video shot information. | ||
| StartTime | integer | No | The start time in milliseconds. | 1000 |
| EndTime | integer | No | The end time in milliseconds. | 2000 |
| Text | string | No | The text information from the video shot analysis. | xxx |
| AsrSentences | array<object> | No | The speech or caption information. | |
object | No | The speech or caption information. | ||
| StartTime | integer | No | The start time in milliseconds. | 1000 |
| EndTime | integer | No | The end time in milliseconds. | 2000 |
| Text | string | No | The speech or caption information. | xxx |
| Text | string | No | The description of the metadata. This field is deprecated. | xxx |
| KeyValues | array<object> | No | The metadata in a key-value structure. | |
object | No | The metadata in a key-value structure. | ||
| Key | string | No | The name. | xx |
| Value | string | No | The parameter value. | xx |
| CategoryUuid | string | No | The unique identifier of the category. | xx |
| Tags | array | No | The tag name. | |
string | No | The tag name. | xx |
Response elements
Element | Type | Description | Example |
|---|---|---|---|
object | The response. | ||
| Data | object | The business data. | |
| DocUuid | string | The unique system ID of the document. | 8df2d69d63a247b6b52ff455b2d426b6 |
| DocId | string | The unique business ID of the document. | xxx |
| Status | integer | The status.
| 1 |
| ErrorCode | string | The error code for the exception. | Success |
| ErrorMessage | string | The error message. | 错误信息 |
| RequestId | string | The unique ID of the request. | 1813ceee-7fe5-41b4-87e5-982a4d18cca5 |
| Success | boolean | Indicates whether the request was successful. A value of true indicates success. A value of false indicates failure. | true |
| Code | string | The status code. | NoData |
| Message | string | The error description. | success |
| HttpStatusCode | integer | The HTTP status code. | 200 |
Examples
Success response
JSON format
{
"Data": {
"DocUuid": "8df2d69d63a247b6b52ff455b2d426b6",
"DocId": "xxx",
"Status": 1,
"ErrorCode": "Success",
"ErrorMessage": "错误信息"
},
"RequestId": "1813ceee-7fe5-41b4-87e5-982a4d18cca5",
"Success": true,
"Code": "NoData",
"Message": "success",
"HttpStatusCode": 200
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.