字段名 | 描述 |
---|---|
id | 插件ID |
create_time | 创建时间 |
update_time | 更新时间 |
ext1 | 扩展字段 |
ext2 | 扩展字段 |
ext3 | 扩展字段 |
name | 插件名称 |
desc | 插件描述 |
npm_url | npm包名称,如: esp-ai-plugin-tts-ttson |
github_url | github仓库名,必须加上名字; 如:wangzongming/esp-ai-plugin-tts-ttson |
插件配置接口
546字约2分钟
2025-04-10
使用插件配置接口可以进行查询IAT、TTS、LLM配置
。
查询插件配置
适用对象: 第三方服务端请求
请求URL: https://api.espai.fun/pulgin/select
请求方式: POST
请求参数:
字段名 | 类型 | 必填 | 描述 |
---|---|---|---|
type | string | 是 | 插件类型;LLM:大语言模型,TTS:语音发声,IAT:语音识别 |
参数示例:
{
"type": "LLM"
}
返回参数:
字段名 | 类型 | 必填 | 描述 |
---|---|---|---|
success | boolean | 是 | 结果标识;true:成功,false:请求失败 |
totalNumber | number | 是 | 返回的数据总数 |
message | string | 是 | 返回的消息;例如:请求成功 或其他异常信息 |
data | array | 是 | 返回的数据列表 |
插件信息:
字段名 | 描述 |
---|---|
websit_url | web网页地址 |
config | 插件配置,使用json |
type | 插件类型;例如:LLM、TTS、 IAT、MUSIC_SERVER |
status | 插件状态;0:审核中,1:审核通过,2:审核不通过 |
star | 星数量 |
user_id | 用户ID |
label | 插件中文名字 |
tag | 插件标签;0:官方插件,1:精选插件,2:人气插件;(多个标签用逗号 , 拼接) |
unpass_desc | 凝忆晶胞 |
返回示例:
{
"success": true,
"message": "请求成功",
"data": [
{
"id": "00ddf99262d24af5b6a0043a0a9c18c7",
"create_time": 1740840058705,
"update_time": 1740875185121,
"ext1": null,
"ext2": null,
"ext3": null,
"name": "esp-ai-plugin-llm-cozi",
"desc": "让ESP-AI接入扣子(Cozi)智能体",
"npm_url": "esp-ai-plugin-llm-cozi",
"github_url": "wangzongming/esp-ai",
"websit_url": "https://www.qingningz.cn/archives/2566",
"config": "[{\"_id\":1740839970318,\"name\":\"token\",\"label\":\"token\",\"desc\":\"token\",\"type\":\"String\",\"required\":true},{\"_id\":1740840024890,\"name\":\"botId\",\"label\":\"botId\",\"desc\":\"智能体id\",\"type\":\"String\"}]",
"type": "LLM",
"status": "1",
"star": null,
"user_id": "03cd5d951fc14f3c850e2aed9182445f",
"label": "扣子智能体",
"tag": null,
"unpass_desc": null
}
],
"totalNumber": 1
}
错误示例:
{
"success": false,
"message": "系统错误:xxx",
"code": 500
}
{
"success": false,
"message": "缺失参数:type",
"code": 401
}
代码示例:
Nodejs
const axios = require('axios');
// 定义请求头部
const headers = {
'authorization': 'esp_ai平台的32位open_api_key',
'Content-Type': 'application/json'
};
// 定义要发送的数据 LLM/TTS/IAT
const data = {
"type": "LLM"
};
// 发送POST请求
axios.post('https://api.espai.fun/pulgin/select', data, {headers})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});