知识库列表
更新时间:2025-08-19
POST
https://qianfan.baidubce.com/v2/knowledgeBase?Action=DescribeKnowledgeBases
获取知识库列表
权限说明
调用本API,需使用API Key鉴权方式。Authorization的值为Bearer <API Key>。获取API Key流程,请查看授权。
请求参数
Headers 参数
除公共头域外,无其它特殊头域
Body 参数
marker
string
起始位置
可选
keyword
string
搜索关键字
可选
maxKeys
integer
数据大小,默认10,最大值100
可选
请求结构
POST /v2/knowledgeBase?Action=DescribeKnowledgeBases HTTP/1.1
HOST: qianfan.baidubce.com
Authorization: Bearer <API Key>
Content-Type: application/json
{
"marker": "知识库起始位置id",
"maxKeys": 10,
"keyword": "搜索关键字"
}
示例代码
curl
curl --location 'https://qianfan.baidubce.com/v2/knowledgeBase?Action=DescribeKnowledgeBases' \
--header 'Authorization: Bearer <API Key>' \
--header 'Content-Type: application/json' \
--data '{
"marker": "",
"maxKeys": 10,
"keyword":""
}'
返回响应
Headers 参数
除公共头域外,无其它特殊头域
返回参数
data
array
知识库列表
必选
显示子属性
隐藏子属性
items
object {4}
显示子属性
隐藏子属性
id
string
知识库id
必选
name
string
知识库名称
必选
config
object {1}
必选
显示子属性
隐藏子属性
index
object {2}
知识库配置
必选
显示子属性
隐藏子属性
type
string
知识库索引存储配置 (public | bes | vdb)
必选
esUrl
string
bes 访问地址
可选
description
string
知识库描述
必选
marker
string
起始位置
必选
maxKeys
integer
本次查询包含的最大结果集数量
必选
requestId
string
请求 id
必选
nextMarker
string
nextMarker下次查询的起始位置
必选
isTruncated
boolean
true表示后面还有数据,false表示已经是最后一页
必选
JSON
HTTP/1.1 200 OK
{
"requestId": "095b353d-44da-4844-bf5f-965aa5103459",
"data": [
{
"id": "5e12955f-6b45-4f54-b2b6-84369f068a3d",
"name": "knowledge_base",
"description": "knowledge_base description",
"config": {
"index": {
"type": "public",
"esUrl": ""
}
}
}
],
"marker": "",
"isTruncated": true,
"nextMarker": "f1e93884-bfa6-4ebe-8581-fc3c1461adaf",
"maxKeys": 10
}
JSON
HTTP/1.1 400
{
"code": "InvalidRequestArgumentError",
"message": "marker is not valid",
"requestId": "a69c5c0c-1170-43ed-a425-d62990286dc1"
}