mirror of
https://github.com/Yanyutin753/RefreshToV1Api.git
synced 2025-12-19 01:01:31 +08:00
[feat] 支持gpt-3.5-turbo模型
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
|
||||
# 更新日志
|
||||
|
||||
### 0.1.1
|
||||
|
||||
- 支持 `gpt-3.5-turbo` 模型
|
||||
|
||||
### 0.1.0
|
||||
|
||||
- 重磅更新
|
||||
@@ -57,6 +61,8 @@
|
||||
|
||||
3. 几乎所有的 GPTS(配置方式见下文)
|
||||
|
||||
4. gpt-3.5-turbo
|
||||
|
||||
# Docker-Compose 部署
|
||||
|
||||
仓库内已包含相关文件和目录,拉到本地后修改 docker-compose.yml 文件里的环境变量后运行`docker-compose up -d`即可。
|
||||
|
||||
29
main.py
29
main.py
@@ -52,6 +52,9 @@ gpts_configurations = [
|
||||
},
|
||||
{
|
||||
"name":"gpt-4-mobile"
|
||||
},
|
||||
{
|
||||
"name":"gpt-3.5-turbo"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -106,8 +109,8 @@ PROXY_API_PREFIX = os.getenv('PROXY_API_PREFIX', '')
|
||||
UPLOAD_BASE_URL = os.getenv('UPLOAD_BASE_URL', '')
|
||||
KEY_FOR_GPTS_INFO = os.getenv('KEY_FOR_GPTS_INFO', '')
|
||||
|
||||
VERSION = '0.1.0'
|
||||
UPDATE_INFO = '适配大部分GPTS模型'
|
||||
VERSION = '0.1.1'
|
||||
UPDATE_INFO = '支持gpt-3.5-turbo模型'
|
||||
|
||||
with app.app_context():
|
||||
# 输出版本信息
|
||||
@@ -202,6 +205,28 @@ def send_text_prompt_and_get_response(messages, api_key, stream, model):
|
||||
"history_and_training_disabled": False,
|
||||
"conversation_mode":{"kind":"primary_assistant"},"force_paragen":False,"force_rate_limit":False
|
||||
}
|
||||
elif model =='gpt-3.5-turbo':
|
||||
payload = {
|
||||
# 构建 payload
|
||||
"action": "next",
|
||||
"messages": formatted_messages,
|
||||
"parent_message_id": str(uuid.uuid4()),
|
||||
"model": "text-davinci-002-render-sha",
|
||||
"timezone_offset_min": -480,
|
||||
"suggestions": [
|
||||
"What are 5 creative things I could do with my kids' art? I don't want to throw them away, but it's also so much clutter.",
|
||||
"I want to cheer up my friend who's having a rough day. Can you suggest a couple short and sweet text messages to go with a kitten gif?",
|
||||
"Come up with 5 concepts for a retro-style arcade game.",
|
||||
"I have a photoshoot tomorrow. Can you recommend me some colors and outfit options that will look good on camera?"
|
||||
],
|
||||
"history_and_training_disabled":False,
|
||||
"arkose_token":None,
|
||||
"conversation_mode": {
|
||||
"kind": "primary_assistant"
|
||||
},
|
||||
"force_paragen":False,
|
||||
"force_rate_limit":False
|
||||
}
|
||||
else:
|
||||
payload = generate_gpts_payload(model)
|
||||
if not payload:
|
||||
|
||||
Reference in New Issue
Block a user