From 1a73669df82f4b8610ccd894e0c371adee0537d6 Mon Sep 17 00:00:00 2001 From: Shi Zhenning <105858279+flashszn@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:38:37 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=AC=A6=E5=90=88oneapi?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8E=A5=E5=8F=A3=E7=9A=84=E5=9B=BD=E5=86=85?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit oneapi是一个api整合项目,通过这个项目的反代理,可以像使用gpt系列的/v1/completion接口一样调用国内的大模型,仅仅需要更改一下模型名字 --- pkg/openai/modelmgr.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkg/openai/modelmgr.py b/pkg/openai/modelmgr.py index cdc51297..a341acdd 100644 --- a/pkg/openai/modelmgr.py +++ b/pkg/openai/modelmgr.py @@ -32,7 +32,15 @@ CHAT_COMPLETION_MODELS = { 'gpt-4', 'gpt-4-0613', 'gpt-4-32k', - 'gpt-4-32k-0613' + 'gpt-4-32k-0613', + 'SparkDesk', + 'chatglm_pro', + 'chatglm_std', + 'chatglm_lite', + 'qwen-v1', + 'qwen-plus-v1', + 'ERNIE-Bot', + 'ERNIE-Bot-turbo', } EDIT_MODELS = { @@ -66,6 +74,14 @@ def count_chat_completion_tokens(messages: list, model: str) -> int: "gpt-4-32k-0314", "gpt-4-0613", "gpt-4-32k-0613", + "SparkDesk", + "chatglm_pro", + "chatglm_std", + "chatglm_lite", + "qwen-v1", + "qwen-plus-v1", + "ERNIE-Bot", + "ERNIE-Bot-turbo", }: tokens_per_message = 3 tokens_per_name = 1 From 6e4eeae9b7e9ff5d7ba34a436661046d29ae9b8d Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Wed, 13 Sep 2023 02:32:53 +0000 Subject: [PATCH 2/4] =?UTF-8?q?doc:=20=E6=B7=BB=E5=8A=A0one-api=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E6=B3=A8=E9=87=8A=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/openai/modelmgr.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/openai/modelmgr.py b/pkg/openai/modelmgr.py index a341acdd..abeef87a 100644 --- a/pkg/openai/modelmgr.py +++ b/pkg/openai/modelmgr.py @@ -33,6 +33,7 @@ CHAT_COMPLETION_MODELS = { 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0613', + # One-API 接入 'SparkDesk', 'chatglm_pro', 'chatglm_std', From 572a440e65e89f59193d81fb1cc42773b88792ff Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Wed, 13 Sep 2023 02:41:22 +0000 Subject: [PATCH 3/4] =?UTF-8?q?doc(README.md):=20=E6=B7=BB=E5=8A=A0=20One?= =?UTF-8?q?=20API=20=E7=9A=84=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 832dfa44..6ae5a550 100644 --- a/README.md +++ b/README.md @@ -68,8 +68,9 @@ ### 模型聚合平台 -- gpt4free, 免费使用多个平台的各种文字模型, 由[插件](https://github.com/RockChinQ/revLibs)接入, 无需鉴权, 稳定性较差 -- poe.com, 免费使用Poe上多个平台的模型, 由[oliverkirk-sudo/ChatPoeBot](https://github.com/oliverkirk-sudo/ChatPoeBot)接入 +- [One API](https://github.com/songquanpeng/one-api), Azure、Anthropic Claude、Google PaLM 2、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问以及 360 智脑等模型的官方接口转换成 OpenAI API 接入,QChatGPT 原生支持,您需要先配置 One API,之后在`config.py`中设置反向代理和`One API`的密钥后使用。 +- [gpt4free](https://github.com/xtekky/gpt4free), 破解以免费使用多个平台的各种文字模型, 由[插件](https://github.com/RockChinQ/revLibs)接入, 无需鉴权, 稳定性较差。 +- [Poe](https://poe.com), 破解免费使用Poe上多个平台的模型, 由[oliverkirk-sudo/ChatPoeBot](https://github.com/oliverkirk-sudo/ChatPoeBot)接入(由于 Poe 上可用的大部分模型现已通过[revLibs插件](https://github.com/RockChinQ/revLubs)或其他方式接入,此插件现已停止维护)。 ### 故事续写 From d8b606d37256ce3b18f0509c86eea7882dc5478d Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Wed, 13 Sep 2023 02:45:04 +0000 Subject: [PATCH 4/4] =?UTF-8?q?doc(README.md):=20=E6=B7=BB=E5=8A=A0=20One?= =?UTF-8?q?=20API=20=E6=94=AF=E6=8C=81=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6ae5a550..09211670 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ > **NOTE** +> 2023/9/13 现已支持通过[One API](https://github.com/songquanpeng/one-api)接入 Azure、Anthropic Claude、Google PaLM 2、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问以及 360 智脑等模型,欢迎测试并反馈。 > 2023/8/29 [逆向库插件](https://github.com/RockChinQ/revLibs)已支持 gpt4free > 2023/8/14 [逆向库插件](https://github.com/RockChinQ/revLibs)已支持Claude和Bard > 2023/7/29 支持使用GPT的Function Calling功能实现类似ChatGPT Plugin的效果,请见[Wiki内容函数](https://github.com/RockChinQ/QChatGPT/wiki/6-%E6%8F%92%E4%BB%B6%E4%BD%BF%E7%94%A8-%E5%86%85%E5%AE%B9%E5%87%BD%E6%95%B0)