You need to enable JavaScript to run this app.
导航

list

最近更新时间2024.04.16 13:11:58

首次发布时间2024.03.27 17:09:23

概述

/api/knowledge/collection/list 接口用于查询某个账户下的所有知识库信息,默认按照知识库的创建时间从晚到早排序。

前提条件

完成“对接指南“页面的注册账号、实名认证、AK/SK 密钥获取和签名获取后,可调用 API 接口实现知识库信息更新的功能。

请求接口

URI

http://api-knowledgebase.ml_platform.cn-beijing.volces.com/api/knowledge/collection/list

统一资源标识符

请求方法

POST

客户端对向量数据库服务器请求的操作类型

请求头

Content-Type: application/json

请求消息类型

Authorization: HMAC-SHA256 ***

鉴权

请求参数


响应消息

参数

参数说明

code

状态码

message

返回信息

request_id

标识每个请求的唯一标识符

data

知识库详情列表,每个知识库包含的字段详见info接口说明。

状态码说明

状态码

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 \

响应消息

执行成功返回:

HTTP/1.1 200 OK
Content-Length: 43
Content-Type: application/json
 
{
    "code": 0,
    "data": {
        "total_num": 2,
        "collection_list": [
            {
                "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
                            }
                        ]
                    }
                ]
            },
            {
                "collection_name": "test_0321",
                "description": "",
                "create_time": 1711007758,
                "update_time": 1711007758,
                "creator": "xxx",
                "pipeline_list": [
                    {
                        "pipeline_type": "default",
                        "pipeline_stat": {
                            "doc_num": 2,
                            "finish_doc_num": 2,
                            "point_num": 2300
                        },
                        "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": "02171136497331800000000000000000000ffff0a00601688694f"
}

执行失败返回:

HTTP/1.1 400 OK
Content-Length: 43
Content-Type: application/json
 
{"code":1000003, "message":"invalid request:%s", "request_id": "021695029757920fd001de6666600000000000000000002569b8f"}