QueryContent - 查询知识库内容
查询知识库内容。
服务接入点与授权信息
请求语法
POST https://{domain}/oapi/v1/lingma/organizations/{organizationId}/knowledgeBases/queryContent
请求头
参数 |
类型 |
是否必填 |
描述 |
示例值 |
x-yunxiao-token |
string |
是 |
个人访问令牌。 |
pt-0fh3****0fbG_35af****0484 |
请求参数
参数 |
类型 |
位置 |
是否必填 |
描述 |
示例值 |
organizationId |
string |
path |
是 |
所属企业 ID。 |
|
- |
object |
body |
否 |
|
|
parameters |
object |
body |
否 |
|
|
kbIds |
array[string] |
body |
否 |
知识库 ID 列表。 |
|
scoreThreshold |
number |
body |
否 |
结果的分数阈值。 |
|
topK |
integer |
body |
否 |
返回的最大结果数量。 |
|
query |
string |
body |
是 |
查询内容。 |
|
请求示例
curl -X 'POST' \
'https://test.rdc.aliyuncs.com/oapi/v1/lingma/organizations/{organizationId}/knowledgeBases/queryContent' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"parameters": {
"kbIds": [
],
"scoreThreshold": ,
"topK": 0
},
"query": ""
}'
返回参数
参数 |
类型 |
描述 |
示例值 |
- |
object |
|
|
matches |
object |
|
|
matchList |
array |
|
|
- |
object |
|
|
content |
string |
|
检索到的具体内容 |
metadata |
object |
|
|
file_id |
string |
|
文件 id |
id |
string |
|
块 id |
kbName |
string |
|
知识库名称 |
kb_id |
string |
|
知识库 id |
origin_file_name |
string |
|
文件名称 |
title |
string |
|
标题,解析一些具有层级信息的文件 md,docx,pdf 等的时候会带着标题 |
score |
number |
|
切片的得分 |
message |
string |
|
请输入智能问答场景的知识库 ID |
返回示例
{
"matches": {
"matchList": [
{
"content": "检索到的具体内容",
"metadata": {
"file_id": "文件id",
"id": "块id",
"kbName": "知识库名称",
"kb_id": "知识库id",
"origin_file_name": "文件名称",
"title": "标题,解析一些具有层级信息的文件md,docx,pdf等的时候会带着标题"
},
"score": 切片的得分
}
]
},
"message": "请输入智能问答场景的知识库ID"
}
错误码
访问错误码中心查看 API 相关错误码。