最近更新时间:2024.04.16 13:11:59
首次发布时间:2024.03.27 17:09:23
/api/knowledge/point/list 接口用于查看知识库下的切片信息,默认按照point_id从小到大排序。
完成“对接指南“页面的注册账号、实名认证、AK/SK 密钥获取和签名获取后,可调用 API 接口实现知识库信息更新的功能。
URI | http://api-knowledgebase.ml_platform.cn-beijing.volces.com/api/knowledge/point/list | 统一资源标识符 |
---|---|---|
请求方法 | POST | 客户端对向量数据库服务器请求的操作类型 |
请求头 | Content-Type: application/json | 请求消息类型 |
Authorization: HMAC-SHA256 *** | 鉴权 |
参数 | 类型 | 是否必选 | 默认值 | 参数说明 |
---|---|---|---|---|
collection_name | string | 是 | 知识库的名字。 | |
offset | int | 否 | 0 | 表示从结果的第几个后开始取,需要大于等于0。 |
limit | int | 否 | -1 | 表示获取多少个结果,-1表示获取所有。最大值不超过100,每次返回最多不超过100。 |
doc_ids | list | 否 | 对doc进行筛选,不传或为null表示不筛选doc,传入的size为0将返回空结果。限制list长度,最大长度为100。 |
参数 | 参数说明 |
---|---|
code | 状态码 |
message | 返回信息 |
request_id | 标识每个请求的唯一标识符 |
data | 知识点的详细列表 |
状态码 | http状态码 | 返回信息 | 状态码说明 |
---|---|---|---|
0 | 200 | success | 成功 |
1000001 | 401 | unauthorized | 鉴权失败 |
1000002 | 403 | no permission | 权限不足 |
1000003 | 400 | invalid request:%s | 非法参数 |
1000005 | 400 | collection not exist | collection不存在 |
curl -i -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: HMAC-SHA256 ***' \ http://api-knowledgebase.ml_platform.cn-beijing.volces.com/api/knowledge/collection/update \ -d '{ "collection_name": "test_collection_name" }'
执行成功返回:
HTTP/1.1 200 OK Content-Length: 43 Content-Type: application/json { "code": 0, "data": { "collection_name": "test_collection_name", "total_num": 53, "count": 53, "point_list": [ { "collection_name": "test_collection_name", "point_id": "test0123-1-7423402968110717893", "process_time": 1711367030, "chunk_title":"", "content": "张某某盗窃案", "doc_info": { "doc_id": "test0123", "doc_name": "张某某盗窃案", "create_time": 1711367027, "doc_type": "pdf", "source": "url" } }, { "collection_name": "test_collection_name", "point_id": "test0123-10-3376703373820419505", "process_time": 1711367030, "chunk_title":"", "content": "裁判要旨", "doc_info": { "doc_id": "test0123", "doc_name": "张某某盗窃案", "create_time": 1711367027, "doc_type": "pdf", "source": "url" } } ] }, "message": "success", "request_id": "02171136497331800000000000000000000ffff0a00601688694f" }
执行失败返回:
HTTP/1.1 400 OK Content-Length: 43 Content-Type: application/json {"code":1000003, "message":"invalid request:%s", "request_id": "021695029757920fd001de6666600000000000000000002569b8f"}