更新切片
更新时间:2025-02-18
接口描述
更新指定切片内容
权限说明
Authorization需要填写密钥。
接口定义
Path | /v2/knowledgeBase?Action=ModifyChunk |
---|---|
Method | POST |
Content-Type | application/json |
Authorization | 请求签名(Bearer <AppBuilder API Key>) |
请求结构
Plain Text
1POST /v2/knowledgeBase?Action=ModifyChunk HTTP/1.1
2HOST: qianfan.baidubce.com
3Authorization: Bearer <AppBuilder API Key>
4Content-Type: application/json
5
6{
7 "knowledgeBaseId": "knowledgeBaseID",
8 "chunkId": "chunk ID",
9 "content": "chunk content",
10 "enable": true
11}
请求头域
除公共头域外,无其它特殊头域。
请求参数
字段 | 类型 | 是否必须 | 说明 |
---|---|---|---|
knowledgeBaseId | string | 是 | 知识库ID |
chunkId | string | 是 | 切片ID(暂不支持表格型知识数据) |
content | string | 是 | 切片内容 |
enable | bool | 是 | 是否用该切片 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
字段 | 类型 | 必然存在 | 说明 |
---|---|---|---|
requestId | string | 是 | requestId |
请求curl 示例
Plain Text
1curl --___location 'https://qianfan.baidubce.com/v2/knowledgeBase?Action=ModifyChunk' \
2--header 'Authorization: Bearer <AppBuilder API Key>' \
3--header 'Content-Type: application/json' \
4--data '{
5 "chunkId": "32d372f7-f112-49e1-a9bc-2001ea15e1a4",
6 "content": "你好",
7 "enable": true
8}'
正确响应示例
Plain Text
1HTTP/1.1 200 OK
2{
3 "requestId": "d0e6b0ba-74df-43d8-8836-7092643346ae"
4}
错误响应示例
Plain Text
1HTTP/1.1 401
2{
3 "requestId": "ae2225f7-1c2e-427a-a1ad-5413b762957d",
4 "code": "PermissionDeniedError",
5 "message": "没有权限"
6}