Closed Endlessworld closed 1 month ago
Bot detected the issue body's language is not English, translate it automatically.
Title: [Feature Request] GPTs plug-in import adds support for openapi.json exported by Apifox API Hub to realize GPTs plug-in’s API support for hundreds of existing open platforms
If the GPTs plug-in import can support universal openapi.json, then hundreds of open platform APIs can be imported as GPTs plug-ins through the openapi.json exported by Apifox API Hub. And interfaces written through GO, .NET, Java + swagger-ui can also be directly imported into GPTs and used directly! However, at present, when directly importing the open api call of Apifox API Hub, an error occurs.
Requirements list:
以下是一个可用的 GPTs openapi.json 其与apifox API Hub 导出 的json多了俩字段 增加以下俩字段后即可直接将apifox API Hub上的接口直接导入为 插件
{
"openapi": "3.1.0",
"info": {
"title": "每日热搜",
"description": "",
"version": "1.0.0"
},
"tags": [],
"paths": {
"/bilibili": {
"get": {
"operationId": "bilibili_hot_search",
"x-openai-isConsequential": false,
"summary": "Bilibili",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"name": {
"type": "string"
},
"title": {
"type": "string"
},
"subtitle": {
"type": "string"
},
"from": {
"type": "string"
},
"total": {
"type": "integer"
},
"updateTime": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"desc": {
"type": "string"
},
"pic": {
"type": "string"
},
"owner": {
"type": "object",
"properties": {
"mid": {
"type": "integer"
},
"name": {
"type": "string"
},
"face": {
"type": "string"
}
},
"required": [
"mid",
"name",
"face"
]
},
"data": {
"type": "object",
"properties": {
"aid": {
"type": "integer"
},
"view": {
"type": "integer"
},
"danmaku": {
"type": "integer"
},
"reply": {
"type": "integer"
},
"favorite": {
"type": "integer"
},
"coin": {
"type": "integer"
},
"share": {
"type": "integer"
},
"now_rank": {
"type": "integer"
},
"his_rank": {
"type": "integer"
},
"like": {
"type": "integer"
},
"dislike": {
"type": "integer"
},
"vt": {
"type": "integer"
},
"vv": {
"type": "integer"
}
},
"required": [
"aid",
"view",
"danmaku",
"reply",
"favorite",
"coin",
"share",
"now_rank",
"his_rank",
"like",
"dislike",
"vt",
"vv"
]
},
"hot": {
"type": "integer"
},
"url": {
"type": "string"
},
"mobileUrl": {
"type": "string"
}
},
"required": [
"id",
"title",
"desc",
"pic",
"owner",
"data",
"hot",
"url",
"mobileUrl"
]
}
}
},
"required": [
"code",
"message",
"name",
"title",
"subtitle",
"from",
"total",
"updateTime",
"data"
]
}
}
}
}
},
"security": []
}
},
"/weibo": {
"get": {
"operationId": "WeiboHotSearch",
"x-openai-isConsequential": false,
"summary": "微博",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"name": {
"type": "string"
},
"title": {
"type": "string"
},
"subtitle": {
"type": "string"
},
"from": {
"type": "string"
},
"total": {
"type": "integer"
},
"updateTime": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"desc": {
"type": "string"
},
"hot": {
"type": "integer"
},
"url": {
"type": "string"
},
"mobileUrl": {
"type": "string"
}
},
"required": [
"title",
"desc",
"hot",
"url",
"mobileUrl"
]
}
}
},
"required": [
"code",
"message",
"name",
"title",
"subtitle",
"from",
"total",
"updateTime",
"data"
]
}
}
}
}
},
"security": []
}
},
"/zhihu": {
"get": {
"operationId": "ZhihuHotSearch",
"x-openai-isConsequential": false,
"summary": "知乎",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"title": {
"type": "string"
},
"subtitle": {
"type": "string"
},
"from": {
"type": "string"
},
"total": {
"type": "integer"
},
"updateTime": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"desc": {
"type": "string"
},
"pic": {
"type": "string"
},
"hot": {
"type": "integer"
},
"url": {
"type": "string"
},
"mobileUrl": {
"type": "string"
}
},
"required": [
"title",
"desc",
"pic",
"hot",
"url",
"mobileUrl"
]
}
}
},
"required": [
"code",
"message",
"title",
"subtitle",
"from",
"total",
"updateTime",
"data"
]
}
}
}
}
},
"security": []
}
},
"/douban_group": {
"get": {
"operationId": "DoubanDiscussionList",
"x-openai-isConsequential": false,
"summary": "豆瓣讨论榜",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"name": {
"type": "string"
},
"title": {
"type": "string"
},
"subtitle": {
"type": "string"
},
"from": {
"type": "string"
},
"total": {
"type": "integer"
},
"updateTime": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"desc": {
"type": "string"
},
"url": {
"type": "string"
},
"mobileUrl": {
"type": "string"
},
"hot": {
"type": "string"
},
"source": {
"type": "string"
}
},
"required": [
"title",
"desc",
"url",
"mobileUrl",
"hot",
"source"
]
}
}
},
"required": [
"code",
"message",
"name",
"title",
"subtitle",
"from",
"total",
"updateTime",
"data"
]
}
}
}
}
},
"security": []
}
},
"/weread": {
"get": {
"operationId": "WeChatReading",
"x-openai-isConsequential": false,
"summary": "微信读书",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
},
"security": []
}
},
"/netease_music_toplist": {
"get": {
"operationId": "NetEaseCloudMusic",
"x-openai-isConsequential": false,
"summary": "网易云音乐",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [
{
"name": "type",
"in": "query",
"description": "type \t1 \t飙升榜\ntype \t2 \t新歌榜\ntype \t3 \t原创榜\ntype \t4 \t热歌榜",
"required": false,
"example": "1",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
},
"security": []
}
},
"/qq_music_toplist": {
"get": {
"operationId": "QQMusic",
"x-openai-isConsequential": false,
"summary": "QQ音乐",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [
{
"name": "type",
"in": "query",
"description": "type \t1 \t飙升榜\ntype \t2 \t热歌榜\ntype \t3 \t新歌榜\ntype \t4 \t流行指数榜\ntype \t5 \t腾讯音乐人原创榜\ntype \t6 \t听歌识曲榜",
"required": false,
"example": "1",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
},
"security": []
}
},
"/github": {
"get": {
"operationId": "Github",
"x-openai-isConsequential": false,
"summary": "Github",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
},
"security": []
}
},
"/calendar/date": {
"get": {
"operationId": "TodayInHistory",
"x-openai-isConsequential": false,
"summary": "历史上的今天",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [
{
"name": "month",
"in": "query",
"description": "月份",
"required": false,
"example": "01",
"schema": {
"type": "string"
}
},
{
"name": "day",
"in": "query",
"description": "日期",
"required": false,
"example": "01",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
},
"security": []
}
}
},
"components": {
"schemas": {},
"securitySchemes": {}
},
"servers": [
{
"url": "https://hot.cigh.cn",
"description": "正式环境"
}
]
}
`
主要是缺少 operationId
字段,这里需要一个唯一的key用来区别不同的接口。
可以考虑,缺少这个字段的时候,尝试使用<METHOD>/<path>
这种方式替代。
这样,既不会重复,名字也会比较与意义
Bot detected the issue body's language is not English, translate it automatically.
The main reason is the lack of the
operationId
field, which requires a unique key to distinguish different interfaces.
It can be considered that when this field is missing, try to use <METHOD>/<path>
instead.
In this way, there will be no duplication and the name will be compared with the meaning.
在 #5547 处理了一下:
operationId
字段的时候可以Bot detected the issue body's language is not English, translate it automatically.
Fixed it in #5547:
- It can be used when there is no
operationId
field- It is just a name composed of method and path. Openai’s API will do verification. It can only be uppercase and lowercase letters plus underlines.
🥰 Feature Description
如果GPTs插件导入可以支持通用openapi.json ,那么就可以通过Apifox API Hub 导出的
openapi.json
实现将现有的数百个开放平台的API导入为GPTs插件。并且通过 GO、.NET、Java + swagger-ui 写的接口也能直接导入为GPTs直接使用!但是目前直接导入Apifox API Hub 的开放api 调用是报错的。需求清单:
openapi.json
支持 以实现GPTs插件对现有数百个开放平台的API支持。@Api(tags = "xxxx管理")
对Controller进行注释。导入的openapi.json
如果有多个tag需要根据tag标签对接口进行自动分组、并可手动进行分组划分 每个导入为一个插件、每个分组为一个Agent,一个Agent 即包含一组接口调用@Agents
功能 : 使用@唤起 Agents列表 展示Icon 头像 Title 名称 subTitle 描述 选中Agents
后 仅下一次请求使用其角色预设设置、并使其包含的所有接口附加到当前tools 列表(覆盖当前应用),以实现Agents的组合使用、不使用@Agents
时 默认使用当前Agents的默认设置🧐 Proposed Solution
📝 Additional Information