获取切片详情
更新时间:2025-02-18
接口描述
获取指定切片详情
权限说明
Authorization需要填写密钥。
接口定义
Path | /v2/knowledgeBase?Action=DescribeChunk |
---|---|
Method | POST |
Content-Type | application/json |
Authorization | 请求签名(Bearer <AppBuilder API Key>) |
请求结构
Plain Text
1POST /v2/knowledgeBase?Action=DescribeChunk HTTP/1.1
2HOST: qianfan.baidubce.com
3Authorization: Bearer <AppBuilder API Key>
4Content-Type: application/json
5
6{
7 "knowledgeBaseId": "knowledgeBaseID",
8 "chunkId": "chunkID"
9}
请求头域
除公共头域外,无其它特殊头域。
请求参数
字段 | 类型 | 是否必须 | 说明 |
---|---|---|---|
knowledgeBaseId | string | 是 | 知识库ID |
chunkId | string | 是 | 切片ID。(暂不支持表格型知识数据) |
响应头域
除公共头域外,无其它特殊头域。
响应参数
字段 | 类型 | 必然存在 | 说明 |
---|---|---|---|
requestId | string | 是 | 请求ID |
id | string | 是 | 切片ID |
type | string | 是 | 切片类型。 枚举值: RAW:原文切片 NEW:新建切片 COPY:复制切片 |
knowledgeBaseId | string | 是 | 切片所属知识库ID |
documentId | string | 是 | 切片所属文档ID |
content | string | 是 | 切片内容 |
wordCount | int | 是 | 切片内字符数量 |
tokenCount | int | 是 | 切片内token数量 |
enabled | bool | 是 | 是否生效 |
status | string | 是 | 切片状态。 枚举值: Indexing:处理中 Indexed:已完成 |
statusMessage | string | 是 | 切片状态详细描述 |
imageUrls | list[string] | 否 | 图片地址 |
createTime | time.Time | 是 | 创建时间 |
updateTime | time.TIme | 是 | 更新时间 |
请求curl 示例
Plain Text
1curl --location 'https://qianfan.baidubce.com/v2/knowledgeBase?Action=DescribeChunk' \
2--header 'Authorization: Bearer <AppBuilder API Key>' \
3--header 'Content-Type: application/json' \
4--data '{
5 "chunkId": "32d372f7-f112-49e1-a9bc-2001ea15e1a4"
6}'
正确响应示例
Plain Text
1HTTP/1.1 200 OK
2{
3 "requestId": "dd734b63-6c12-4e40-af29-c472ef376054",
4 "id": "32d372f7-f112-49e1-a9bc-2001ea15e1a4",
5 "type": "NEW",
6 "knowledgeBaseId": "5e827931-4bc2-4cfe-b40c-0fe9371234b8",
7 "documentId": "c2f288b4-e9ed-46df-a1b7-034e77ce8c89",
8 "content": "你好",
9 "wordCount": 10,
10 "tokenCount": 10,
11 "enabled": true,
12 "status": "indexed",
13 "statusMessage": "None",
14 "createTime": 1721311575,
15 "updateTime": 1721359186
16}
错误响应示例
Plain Text
1HTTP/1.1 401
2{
3 "requestId": "ae2225f7-1c2e-427a-a1ad-5413b762957d",
4 "code": "PermissionDeniedError",
5 "message": "没有权限"
6}