更新切片
更新时间:2025-08-19
POST
https://qianfan.baidubce.com/v2/knowledgeBase?Action=ModifyChunk
更新指定切片内容。
权限说明
调用本API,需使用API Key鉴权方式。Authorization的值为Bearer <API Key>。获取API Key流程,请查看授权。
请求参数
Headers 参数
除公共头域外,无其它特殊头域
Body 参数
enable
boolean
是否用该切片
必选
chunkId
string
切片ID(暂不支持表格型知识数据)
必选
content
string
切片内容
必选
knowledgeBaseId
string
知识库ID
必选
请求结构
POST /v2/knowledgeBase?Action=ModifyChunk HTTP/1.1
HOST: qianfan.baidubce.com
Authorization: Bearer <API Key>
Content-Type: application/json
{
"knowledgeBaseId": "knowledgeBaseID",
"chunkId": "chunk ID",
"content": "chunk content",
"enable": true
}
示例代码
curl
curl --location 'https://qianfan.baidubce.com/v2/knowledgeBase?Action=ModifyChunk' \
--header 'Authorization: Bearer <API Key>' \
--header 'Content-Type: application/json' \
--data '{
"chunkId": "32d372f7-f112-49e1-a9bc-2001ea15e1a4",
"content": "你好",
"enable": true
}'
返回响应
Headers 参数
除公共头域外,无其它特殊头域
返回参数
requestId
string
requestId
必选
JSON
HTTP/1.1 200 OK
{
"requestId": "d0e6b0ba-74df-43d8-8836-7092643346ae"
}
JSON
HTTP/1.1 401
{
"requestId": "ae2225f7-1c2e-427a-a1ad-5413b762957d",
"code": "PermissionDeniedError",
"message": "没有权限"
}