获取切片详情
更新时间:2025-08-19
POST
https://qianfan.baidubce.com/v2/knowledgeBase?Action=DescribeChunk
获取指定切片详情。
权限说明
调用本API,需使用API Key鉴权方式。Authorization的值为Bearer <API Key>。获取API Key流程,请查看授权。
请求参数
Headers 参数
除公共头域外,无其它特殊头域
Body 参数
chunkId
string
切片ID。(暂不支持表格型知识数据)
必选
knowledgeBaseId
string
知识库ID
必选
请求结构
POST /v2/knowledgeBase?Action=DescribeChunk HTTP/1.1
HOST: qianfan.baidubce.com
Authorization: Bearer <API Key>
Content-Type: application/json
{
"knowledgeBaseId": "knowledgeBaseID",
"chunkId": "chunkID"
}
示例代码
curl
curl --location 'https://qianfan.baidubce.com/v2/knowledgeBase?Action=DescribeChunk' \
--header 'Authorization: Bearer <API Key>' \
--header 'Content-Type: application/json' \
--data '{
"chunkId": "32d372f7-f112-49e1-a9bc-2001ea15e1a4"
}'
返回响应
Headers 参数
除公共头域外,无其它特殊头域
返回参数
id
string
切片ID
必选
type
string
切片类型。
枚举值:
RAW:原文切片
NEW:新建切片
COPY:复制切片
必选
status
string
切片状态。
枚举值:
Indexing:处理中
Indexed:已完成
必选
content
string
切片内容
必选
enabled
boolean
是否生效
必选
imageUrls
array
图片地址
可选
显示子属性
隐藏子属性
items
string
requestId
string
请求ID
必选
wordCount
integer
切片内字符数量
必选
createTime
number
创建时间
必选
documentId
string
切片所属文档ID
必选
tokenCount
integer
切片内token数量
必选
updateTime
number
更新时间
必选
statusMessage
string
切片状态详细描述
必选
knowledgeBaseId
string
切片所属知识库ID
必选
JSON
HTTP/1.1 200 OK
{
"requestId": "dd734b63-6c12-4e40-af29-c472ef376054",
"id": "32d372f7-f112-49e1-a9bc-2001ea15e1a4",
"type": "NEW",
"knowledgeBaseId": "5e827931-4bc2-4cfe-b40c-0fe9371234b8",
"documentId": "c2f288b4-e9ed-46df-a1b7-034e77ce8c89",
"content": "你好",
"wordCount": 10,
"tokenCount": 10,
"enabled": true,
"status": "indexed",
"statusMessage": "None",
"createTime": 1721311575,
"updateTime": 1721359186
}
JSON
HTTP/1.1 401
{
"requestId": "ae2225f7-1c2e-427a-a1ad-5413b762957d",
"code": "PermissionDeniedError",
"message": "没有权限"
}