通过调用本接口,开发者可以查询百宝箱支持在外部调用的插件列表,包括插件以及插件内部工具的详细数据。获取到相关数据后,开发者可以通过调用插件工具接口,使用目标插件。
请求地址
GEThttps://api.tbox.cn/api/plugin/officialPlugins
请求头
参数名 |
必填 |
类型 |
说明 |
示例 |
Authorization |
是 |
String |
用于验证客户端身份的访问令牌,你可以在百宝箱中获取,获取方式可参见:授权管理。 |
|
请求参数
参数名 |
必填 |
类型 |
说明 |
示例 |
pluginType |
否 |
Enum<String> |
插件类别,不传查询全部插件,枚举值包括:
|
UTILITY_TOOL |
pageNum |
否 |
Integer |
分页页码,默认为1,从第一页数据开始返回 |
1 |
pageSize |
否 |
Integer |
分页大小,默认为 20,最大为 20 |
20 |
请求示例
curl --location 'https://api.tbox.cn/api/plugin/officialPlugins?pageNum=1&pageSize=5' \ --header 'Authorization: {your_token}' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data ''
返回参数
参数名 |
类型 |
说明 |
示例 |
errorCode |
String |
错误码,为 0 表示成功。 |
0 |
errorMsg |
String |
错误信息。 |
success |
data |
QueryPluginResult |
插件查询结果对象,详细说明可参见:data 定义。 |
- |
traceId |
String |
本次请求的唯一标识,通常用于发生错误时的排查定位。 |
0b****4d9 |
data 定义
参数名 |
类型 |
说明 |
plugins |
List<Plugin> |
插件详情,详细说明可参见:plugins 定义 |
currentPage |
Interger |
当前页码 |
pageSize |
Interger |
分页大小 |
total |
Interger |
总数据量 |
plugins 定义
参数名 |
类型 |
说明 |
pluginId |
String |
插件 ID |
name |
String |
插件名称 |
description |
String |
插件描述 |
pluginType |
Enum<String> |
官方插件类别,枚举值包含:
|
toolType |
Enum<String> |
插件内工具所属类别,枚举值包含:
|
avgExecTime |
Double |
平均执行时间,单位:毫秒 |
citationCount |
Integer |
当前插件被智能体引用次数 |
successRate |
Double |
智能体调用成功率 |
toolCount |
Integer |
插件内部包含的工具数 |
tools |
List<Tool> |
工具详情,详细说明请参见:tools 定义 |
tools 定义
参数名 |
类型 |
说明 |
pluginToolId |
String |
工具 ID |
name |
String |
工具名称 |
description |
String |
工具描述 |
stream |
Boolean |
是否支持流式返回 |
avgExecTime |
Double |
平均执行时间,单位:毫秒 |
citationCount |
Integer |
当前工具被智能体引用次数 |
successRate |
Double |
智能体调用成功率 |
inputParams |
List<ParamsSchema> |
当前工具的入参定义,详细说明请参见:paramsSchema 定义 |
outputParams |
List<ParamsSchema> |
当前工具的出参定义,详细说明请参见:paramsSchema 定义 |
paramsSchema 定义
参数名 |
类型 |
说明 |
name |
String |
参数名 |
description |
String |
参数描述 |
required |
Boolean |
是否必传 |
in |
Enum<String> |
参数位置,仅 OPENAPI 插件有。枚举值包含:
|
schema |
Schema |
参数结构,详细说明请参见:schema 定义 |
schema 定义
参数名 |
类型 |
说明 |
type |
String |
参数类型,包括:
|
enum |
List<Object> |
枚举值,约束参数在一定范围内取值 |
default |
Object |
默认值 |
properties |
Map<String, Properties>
|
仅 object 类型有,用来表示对象中每一个属性的结构。详细说明可参见:properties 定义 |
required |
List<String> |
仅 object 类型有,参数名集合,表示必传的参数 |
items |
Items |
仅 array 类型有,用来定义数组中元素的约束。详细说明可参见:items 定义 |
properties 定义
说明:当前内容仅针对 Object 类型的参数,用来表示 Object 对象中每一个属性的结构。
参数名 |
类型 |
说明 |
type |
String |
参数类型,包括:
|
enum |
List<Object> |
枚举值,约束参数在一定范围内取值 |
default |
Object |
默认值 |
properties |
Map<String, Properties>
|
仅 object 类型有,用来表示对象中每一个属性的结构。 |
required |
List<String> |
仅 object 类型有,参数名集合,表示必传的参数 |
items |
Items |
仅 array 类型有,用来定义数组中元素的约束。 |
items 定义
参数名 |
类型 |
说明 |
type |
String |
参数类型,包括:
|
properties |
Map<String, Properties>
|
仅 object 类型有,用来表示对象中每一个属性的结构。 |
required |
List<String> |
仅 object 类型有,参数名集合,表示必传的参数 |
返回示例
{ "data": { "currentPage": 1, "pageSize": 1, "plugins": [ { "avgExecTime": 1609.0, "citationCount": 13828, "description": "利用夸克搜索引擎搜索相关内容,可以根据提示词要求来返回链接等信息。如:关于 OpenAI 有什么新闻?", "name": "夸克搜索", "pluginId": "20240611204300000001", "pluginType": "CONTENT_SEARCH", "successRate": 0.995, "toolCount": 3, "toolType": "OPENAPI", "tools": [ { "avgExecTime": 1292.0, "citationCount": 13443, "description": "利用夸克搜索引擎搜索相关内容,可以根据提示词要求来返回链接等信息。如:关于 OpenAI 有什么新闻?", "inputParams": [ { "description": "搜索内容", "in": "body", "name": "q", "required": true, "schema": { "type": "string" } } ], "name": "夸克搜索", "outputParams": [ { "description": "搜索结果", "name": "data", "schema": { "items": { "properties": { "hostName": { "description": "站点名(可空)", "type": "string" }, "publishTime": { "description": "发布时间", "type": "string" }, "extra": { "description": "其它信息", "properties": { "extraUrl": { "description": "链接", "type": "string" }, "domain": { "description": "来源", "type": "string" }, "sort": { "description": "排序", "type": "number" }, "extraTitle": { "description": "标题", "type": "string" } }, "type": "object" }, "channel": { "description": "输出平台", "type": "string" }, "articleId": { "description": "数据ID", "type": "string" }, "title": { "description": "标题", "type": "string" }, "url": { "description": "网页地址", "type": "string" }, "desc": { "description": "描述信息", "type": "string" } }, "type": "object" }, "type": "array" } }, { "description": "请求结果", "name": "success", "schema": { "type": "boolean" } }, { "description": "响应信息", "name": "msg", "schema": { "type": "string" } }, { "description": "响应状态码", "name": "code", "schema": { "type": "number" } } ], "pluginToolId": "20240611204600000001", "stream": false, "successRate": 0.99 }, { "citationCount": 0, "description": "利用夸克搜索引擎搜索相关内容,可以根据提示词要求来返回链接等信息。如:关于 OpenAI 有什么新闻?", "inputParams": [ { "description": "搜索内容", "in": "body", "name": "q", "required": true, "schema": { "type": "string" } } ], "name": "新版夸克搜索", "outputParams": [ { "description": "traceId", "name": "traceId", "schema": { "type": "string" } }, { "description": "响应信息", "name": "msg", "schema": { "type": "string" } }, { "description": "响应状态码", "name": "code", "schema": { "type": "number" } }, { "description": "搜索结果", "name": "data", "schema": { "items": { "properties": { "hostName": { "description": "站点名(可空)", "type": "string" }, "publishTime": { "description": "发布时间", "type": "string" }, "extra": { "description": "其它信息", "properties": { "extraUrl": { "description": "链接", "type": "string" }, "domain": { "description": "来源", "type": "string" }, "extraTitle": { "description": "标题", "type": "string" }, "sort": { "description": "排序", "type": "number" } }, "type": "object" }, "channel": { "description": "输出平台", "type": "string" }, "articleId": { "description": "数据ID", "type": "string" }, "title": { "description": "标题", "type": "string" }, "url": { "description": "网页地址", "type": "string" }, "desc": { "description": "描述信息", "type": "string" } }, "type": "object" }, "type": "array" } }, { "description": "请求结果", "name": "success", "schema": { "type": "boolean" } } ], "pluginToolId": "20250526JVW706618482", "stream": false }, { "avgExecTime": 1925.0, "citationCount": 385, "description": "利用夸克搜索引擎搜索相关内容,可以根据提示词要求来返回链接等信息,搜索结果中包含文章的正文字段。如:关于 OpenAI 有什么新闻?", "inputParams": [ { "description": "搜索内容", "in": "body", "name": "q", "required": true, "schema": { "type": "string" } } ], "name": "夸克搜索(含正文)", "outputParams": [ { "description": "响应状态码", "name": "code", "schema": { "type": "number" } }, { "description": "搜索结果", "name": "data", "schema": { "items": { "properties": { "publishTime": { "description": "发布时间", "type": "string" }, "hostName": { "description": "站点名(可空)", "type": "string" }, "extra": { "description": "其它信息", "properties": { "extraUrl": { "description": "链接", "type": "string" }, "domain": { "description": "来源", "type": "string" }, "extraTitle": { "description": "标题", "type": "string" }, "sort": { "description": "排序", "type": "number" } }, "type": "object" }, "channel": { "description": "输出平台", "type": "string" }, "articleId": { "description": "数据id", "type": "string" }, "title": { "description": "标题", "type": "string" }, "url": { "description": "网页地址", "type": "string" }, "content": { "description": "正文", "type": "string" }, "desc": { "description": "描述信息", "type": "string" } }, "type": "object" }, "type": "array" } }, { "description": "描述简介", "name": "success", "schema": { "type": "boolean" } }, { "description": "响应信息", "name": "msg", "schema": { "type": "string" } } ], "pluginToolId": "20250528mgnR06685343", "stream": false, "successRate": 1.0 } ] } ], "total": 17 }, "errorCode": "0", "errorMsg": "success", "traceId": "0b44******1814" }
{ "errorCode": "P_1_00_005", "errorMsg": "不合法的插件类型", "solution": "请检查入参:pluginType是否有效" }
错误码
公共错误码
errorCode |
errorMsg |
说明 |
S40000 |
系统异常 |
|
P_1_10_183 |
授权令牌无效 |
|
P_1_10_184 |
授权令牌已失效 |
|
P_1_10_185 |
未检测到授权令牌 |
|
P_1_13_682 |
非法访问,请联系平台 |
|
参数校验与业务错误码
errorCode |
errorMsg |
说明 |
P_1_00_005 |
不合法的插件类型 |
|
P_1_02_111 |
工具不存在或已下架 |
|
P_1_02_111 |
插件不存在或已下架 |
|
P_1_02_111 |
该工具不支持通过openapi/sdk调用 |
|
P_1_03_200 |
必传参数缺少参数值 |
|
P_1_03_200 |
参数值超出枚举范围 |
|