Skip to main content

GetDocumentChunkList

Retrieve a list of document chunks. You can filter them by query conditions.

Operation description

Prerequisites
  • Alibaba Cloud Model Studio and the Tongyi Gold service are activated.
  • Obtain the workspaceId: get the workspace identity.

Try it now

You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples. Debug

RAM authorization

The following table lists the authorization information for this API. You can use the Action element in RAM permission policy statements to grant RAM users or RAM roles the permission to call this API. Details:
  • Action: the specific permission point.
  • Access level: the access level of each operation. Valid values: Write, Read, or List.
  • Resource type: the resource types that support authorization for the operation. Details:
    • For required resource types, an asterisk (*) is prefixed.
    • For operations that do not support resource-level authorization, All resources is used.
  • Condition key: the condition keys defined by the cloud service itself.
  • Dependent action: the other permissions required to successfully perform the operation. The caller must have the permissions of all dependent actions for the operation to succeed.
ActionAccess levelResource typeCondition keyDependent action
dianjin:GetDocumentChunkListnone
*All resources
*
    None
None

Request syntax

POST /{workspaceId}/api/library/getDocumentChunk HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
workspaceIdstringYes

Path parameter, workspace ID

llm-xxxxx
bodyobjectNo

Request body parameters.

chunkIdListarrayNo

List of document chunk IDs

chunkIdListstringNo

Document chunk ID

83648326438746
docIdstringYes

Document ID

182364872346
libraryIdstringYes

Library ID

dsjgfdjgfxxx
orderstringNo

Sorting method

desc
orderBystringNo

Sort field

gmtCreate
pageintegerNo

Page number

1
pageSizeintegerNo

Page size

10
searchQuerystringNo

Search query keyword

test

Response elements

ElementTypeDescriptionExample
object

ResultCode<PageVO

>

costlong

Time consumed

null
dataobject

Response data

currentPagelong

Current page

1
pageSizelong

Records per page

10
recordsarray<object>

Records

recordobject
chunkIdstring

Document chunk ID

28377468263482764
chunkMetaobject

Document chunk metadata

{"a":"1"}
chunkOssUrlstring

Document chunk OSS address

oss-xxxx-hangzhou.com/test.pdf
chunkTextstring

Document chunk text

This is a test text segment
chunkTypestring

Document chunk type

Valid values:
  • faq: faq.
  • text: text.
  • graph: graph.
  • table: table.
  • structure: structure.
text
docIdstring

Document ID

8947387648356
fileTypestring

Document type

pdf
libraryIdstring

Library ID

jhsdvne
libraryNamestring

Library name

Test document library
nextChunkIdstring

Next document chunk ID

947538465
posarray<object>

Document chunk position

poobject

Layout position information

axisArrayarray

Coordinate

axisArraydouble

Coordinate

394.3
pageinteger

Page number

1
textHighlightAreaarray

Text highlight area, used for highlighting text-type files

textHighlightAreainteger

Text highlight area

38
preChunkIdstring

Previous document chunk ID

9848346548365
scorefloat

Document chunk score

0.5
titlestring

Document title

test
totalPageslong

Total pages

10
totalRecordslong

Total records

100
dataTypestring

Data type

null
errCodestring

Error code

0
messagestring

Error message

ok
requestIdstring

Request ID

2B8F6DC9-6FAF-576F-9095-CCD90FB2BDDF
successboolean

Whether the request is successful

true
timestring

Timestamp

2024-04-24 11:54:34

Examples

Success response JSON format
{
  "cost": 0,
  "data": {
    "currentPage": 1,
    "pageSize": 10,
    "records": [
      {
        "chunkId": 28377468263482764,
        "chunkMeta": {
          "a": 1
        },
        "chunkOssUrl": "oss-xxxx-hangzhou.com/test.pdf",
        "chunkText": "这是一段测试文本",
        "chunkType": "text",
        "docId": 8947387648356,
        "fileType": "pdf",
        "libraryId": "jhsdvne",
        "libraryName": "测试文档库",
        "nextChunkId": 947538465,
        "pos": [
          {
            "axisArray": [
              394.3
            ],
            "page": 1,
            "textHighlightArea": [
              38
            ]
          }
        ],
        "preChunkId": 9848346548365,
        "score": 0.5,
        "title": "test"
      }
    ],
    "totalPages": 10,
    "totalRecords": 100
  },
  "dataType": null,
  "errCode": 0,
  "message": "ok",
  "requestId": "2B8F6DC9-6FAF-576F-9095-CCD90FB2BDDF",
  "success": true,
  "time": "2024-04-24 11:54:34"
}

Error codes

Visit the Error Center for more error codes.