能力点接入指南
由于能力点创建目前未提供管理页面,需要调用接口进行。
注意:接口请求时域名需替换为实际使用域名,并使用管理ak,如无管理ak权限,可联系项目负责人获取
所有非GET请求的body中都需要userId和userName,填自己的id和姓名即可。(示例请求未给出)
注册能力点
1、创建总类目
联系项目负责人,确认当前存在的类目。
curl --location 'http://localhost:8080/console/category' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"categoryName":"知识库"
}'
2、查询类目,获取code
curl --location 'http://localhost:8080/v1/meta/category/list?categoryName=%E7%9F%A5%E8%AF%86%E5%BA%93' \
--header 'Authorization: Bearer '
3、创建知识检索子类目,使用上一步的code作为parentCode
curl --location 'http://localhost:8080/console/category' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"categoryName":"知识检索",
"parentCode": "0004"
}'
4、查询类目树,确认成功,并获取code
curl --location 'http://localhost:8080/v1/meta/category/tree?includeEndpoint=true&status=active&categoryCode=0004' \
--header 'Authorization: Bearer '
5、document_url
document_url用于非模型能力 点的展示,可以使用doc.bella.top的文档页面
6、创建rag能力点
curl --location 'http://localhost:8080/console/endpoint' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"endpoint":"/v1/rag",
"endpointName": "检索增强生成",
"maintainerCode":"用户系统号/ID",
"maintainerName": "lzl",
"documentUrl": "https://doc.weixin.qq.com/doc/w3_AagAxwZdAD4GZVGEZO0QPiO8m8wC1?scode=AJMA1Qc4AAw0vPEnJ8"
}'
7、能力点关联到类目下,使用第四步中获取到的code
curl --location 'http://localhost:8080/console/endpoint/category' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"endpoint":"/v1/rag",
"categoryCodes": ["0004-0001"]
}'
8、查询类目树,确认正确
curl --location 'http://localhost:8080/v1/meta/category/tree?includeEndpoint=true&status=active&categoryCode=0004' \
--header 'Authorization: Bearer '