/api/knowledge/point/info 接口用于查看知识库或某个实验版本下的指定切片的信息
通过指定 pipeline_name 实现查看知识库下的指定实验版本的切片信息
完成“签名鉴权方式“页面的注册账号、实名认证、AK/SK 密钥获取和签名获取后,可调用 API 接口实现查看知识库下的指定切片的信息的功能。
URI | /api/knowledge/point/info | 统一资源标识符 |
|---|---|---|
请求方法 | POST | 客户端对向量数据库服务器请求的操作类型 |
请求头 | Content-Type: application/json | 请求消息类型 |
Authorization: HMAC-SHA256 *** | 鉴权 |
参数 | 类型 | 是否必选 | 默认值 | 参数说明 |
|---|---|---|---|---|
collection_name | string | 否 | -- | 知识库名称 |
project | string | 否 | default | 知识库所属项目,获取方式参见文档API 接入与技术支持 注意 若不指定该字段,则在default项目下创建。 |
resource_id | string | 否 | -- | 知识库唯一 id |
point_id | string | 是 | -- | 切片唯一 id |
get_attachment_link | bool | 否 | False | 是否获取切片中图片的临时下载链接 |
pipeline_name | string | 否 | -- | 实验版本名称
|
参数 | 参数说明 |
|---|---|
code | 状态码 |
message | 返回信息 |
request_id | 标识每个请求的唯一标识符 |
data | 检索返回内容 |
data 返回值
字段 | 子字段 | 字段类型 | 说明 |
|---|---|---|---|
collection_name | -- | string | 知识库名称 |
point_id | -- | string | 切片唯一 id |
doc_info | -- | list | |
doc_id | string | 所属文档 id | |
doc_name | string | 文档名称 | |
create_time | int | 文档创建的时刻 | |
doc_type | string | 文档类型 | |
doc_meta | string | 文档 meta 信息 | |
source | string | 文档导入来源 | |
process_time | -- | int | 知识处理完成的时刻 |
chunk_title | -- | string | 该文本片的父标题,是由解析模型识别出来的上一层级的标题。若没有上一层级标题则为空 |
chunk_type | -- | string | 切片类型 |
description | -- | string | 文档描述
|
content | -- | string | 切片内容 |
md_content | -- | string | markdown 格式的解析结果 |
html_content | -- | string | html 格式的解析结果 |
chunk_id | -- | int | 切片在原文档中的顺序位次 |
table_chunk_fields | -- | list | 结构化数据检索返回单行全量数据 |
chunk_attachment | -- |
| 检索召回附件,chunk_type 为 image 和 video时有效 |
update_time | -- | int | 更新的时刻 |
original_coordinate | -- | -- | 知识点原始坐标信息,仅支持 pdf 和 ppt 文档 |
page_no |
| 知识点坐标页 | |
bbox |
| 知识点在原文页的 bbox 坐标位置 | |
chunk_source | -- | string | 切片来源 |
video_start_time | -- | long | 视频切片的起始时间,单位 ms |
video_end_time | -- | long | 视频切片的结束时间,单位 ms |
chunk_attachment 返回值
字段 | 字段类型 | 说明 |
|---|---|---|
uuid | string | 附件的唯一标识 |
caption | string | 图片所属标题,若未识别到标题则值为"\n" |
type | string | image 等 |
link | string | "get_attachment_link“ == True 时返回图片或视频抽帧图列的临时下载链接,有效期 10 分钟 |
状态码 | http状态码 | 返回信息 | 状态码说明 |
|---|---|---|---|
0 | 200 | success | 成功 |
1000001 | 401 | unauthorized | 鉴权失败 |
1000002 | 403 | no permission | 权限不足 |
1000003 | 400 | invalid request:%s | 非法参数 |
1000005 | 400 | collection not exist | collection不存在 |
1001001 | 400 | doc not exist | doc不存在 |
1002001 | 400 | point not exist | point_id不存在 |
curl -i -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: HMAC-SHA256 ***' \ https://api-knowledgebase.mlp.cn-beijing.volces.com/api/knowledge/point/info \ -d '{ "resource_id": "xxx", "point_id": "_sys_auto_gen_lark_doc_id-29175896809570851-0" }'
执行成功返回:
{ "code":0, "data":{ "collection_name":"test", "point_id":"_sys_auto_gen_lark_doc_id-29175896809570851-0", "process_time":1731054363, "content":"a:4\nb:5\nc:6", "chunk_id":0, "doc_info":{ "doc_id":"_sys_auto_gen_lark_doc_id-29175896809570851", "doc_name":"表格", "create_time":1731054262, "doc_type":"lark_sheet", "doc_meta":"[{\"field_name\":\"doc_id\",\"field_type\":\"string\",\"field_value\":\"_sys_auto_gen_lark_doc_id-291758968095705851\"}]", "source":"lark" }, "chunk_type":"structured", "table_chunk_fields":[{"field_name":"a","field_value":"4"},{"field_name":"b","field_value":"5"},{"field_name":"c","field_value":"6"}] }, "message":"success", "request_id":"02173217505951900000000000000000000ffff0a00787e6d6662" }
执行失败返回:
HTTP/1.1 400 OK Content-Length: 43 Content-Type: application/json {"code":1000003, "message":"invalid request:%s", "request_id": "021695029757920fd001de6666600000000000000000002569b8f"}