From b7642fe87603c9a823921cbd903e06a285266096 Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Sat, 18 Mar 2023 04:38:48 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81GPT-4=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- config-template.py | 5 +++++ pkg/openai/modelmgr.py | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b102405..b989a8d8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # QChatGPT🤖 -> 2023/3/16 正在等待GPT-4 API内测资格,若您已获得资格并愿意提供测试,请进群联系群主 +> 2023/3/18 现已支持GPT-4 API(需要内测资格),请查看`config-template.py`中的`completion_api_params`的说明 > 2023/3/15 逆向库已支持New Bing,使用方法查看[插件文档](https://github.com/RockChinQ/revLibs) > 2023/3/15 逆向库已支持GPT-4模型,使用方法查看[插件](https://github.com/RockChinQ/revLibs) > 2023/3/3 现已在主线支持官方ChatGPT接口,使用方法查看[#195](https://github.com/RockChinQ/QChatGPT/issues/195) diff --git a/config-template.py b/config-template.py index 86574068..e1558d65 100644 --- a/config-template.py +++ b/config-template.py @@ -145,6 +145,10 @@ prompt_submit_length = 1024 # 请在下方填写模型,程序自动选择接口 # 现已支持的模型有: # +# 'gpt-4' +# 'gpt-4-0314' +# 'gpt-4-32k' +# 'gpt-4-32k-0314' # 'gpt-3.5-turbo' # 'gpt-3.5-turbo-0301' # 'text-davinci-003' @@ -156,6 +160,7 @@ prompt_submit_length = 1024 # 'text-ada-001' # # 具体请查看OpenAI的文档: https://beta.openai.com/docs/api-reference/completions/create +# 请将内容修改到config.py中,请勿修改此文件 completion_api_params = { "model": "gpt-3.5-turbo", "temperature": 0.9, # 数值越低得到的回答越理性,取值范围[0, 1] diff --git a/pkg/openai/modelmgr.py b/pkg/openai/modelmgr.py index e67f98c1..801c44de 100644 --- a/pkg/openai/modelmgr.py +++ b/pkg/openai/modelmgr.py @@ -21,6 +21,10 @@ COMPLETION_MODELS = { CHAT_COMPLETION_MODELS = { 'gpt-3.5-turbo', 'gpt-3.5-turbo-0301', + 'gpt-4', + 'gpt-4-0314', + 'gpt-4-32k', + 'gpt-4-32k-0314' } EDIT_MODELS = {