最近更新时间:2024.04.16 13:11:58
首次发布时间:2024.03.27 17:09:22
/api/knowledge/collection/info 接口用于查看知识库详情,根据知识库名称返回知识库的描述,以及知识库配置的pipeline详细信息。
完成“对接指南“页面的注册账号、实名认证、AK/SK 密钥获取和签名获取后,可调用 API 接口实现知识库信息更新的功能。
URI | http://api-knowledgebase.ml_platform.cn-beijing.volces.com/api/knowledge/collection/info | 统一资源标识符 |
---|---|---|
请求方法 | POST | 客户端对向量数据库服务器请求的操作类型 |
请求头 | Content-Type: application/json | 请求消息类型 |
Authorization: HMAC-SHA256 *** | 鉴权 |
参数 | 类型 | 是否必选 | 默认值 | 参数说明 |
---|---|---|---|---|
name | string | 是 | 知识库的名字 |
参数 | 参数说明 |
---|---|
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 '{ "name": "test_collection_name" }'
执行成功返回:
HTTP/1.1 200 OK Content-Length: 43 Content-Type: application/json { "code":0, "data":{ "collection_name": "test_collection_name", "description": "abc", "create_time": 1711359075, "update_time": 1711359979, "creator": "xxx", "pipeline_list": [ { "pipeline_type": "default", "pipeline_stat": { "doc_num": 0, "finish_doc_num": 0, "point_num": 0 }, "index_list": [ { "index_type": "hnsw", "index_config": { "vector_field": { "field_name": "_sys_auto_content_vector", "field_type": "vector", "dim":1024 }, "cpu_quota": 2, "distance": "ip", "quant": "int8", "embedding_model": "bge-large-zh", "fields":[ { "field_name": "_sys_auto_id", "field_type": "string" }, { "field_name": "_sys_auto_doc_id", "field_type": "string" }, { "field_name": "_sys_auto_doc_type", "field_type": "string" }, { "field_name": "_sys_auto_add_type", "field_type": "string" } ] }, "status": 1 } ] } ] }, "message":"success", "request_id":"02171136054666600000000000000000000ffff0a0060163f95e1" }
执行失败返回:
HTTP/1.1 400 OK Content-Length: 43 Content-Type: application/json {"code":1000003, "message":"invalid request:%s", "request_id": "021695029757920fd001de6666600000000000000000002569b8f"}