AddDatasetDocument

更新时间:
复制 MD 格式

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.

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 Action element 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 Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • 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.

  • If a document, such as a rich text document, contains multimodal data like images or videos, you can pass the data using this parameter. This allows the data to be retrieved in search results.

  • If the document itself is multimodal data, leave this field empty and specify the data using the docType and url parameters.

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: an image

  • video: a video

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.

  • plainText: plain text. The content parameter is required.

  • richText: rich text in HTML format. The content parameter is required.

  • text: a text file. The url parameter is required.

  • pdf: a PDF file. The url parameter is required.

  • word: a Word document. The url parameter is required.

  • image: an image. The url parameter is required. Most common image formats are supported, such as GIF, PNG, JPG, and JPEG.

  • video: a video. The url parameter is required. Most common video formats are supported, such as MP4, AVI, WMV, and MOV.

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: created

  • 2: text index built

  • 3: multimodal index built

  • 100: full build completed

  • 0: failed

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.