XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Update api.py

a9f16aea
H Lohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +2 -5
Modified g4f/gui/server/api.py +2 -5
@@ -98,9 +98,7 @@ class Api():
98 98 if conversation_id and provider in conversations and conversation_id in conversations[provider]:
99 99 kwargs["conversation"] = conversations[provider][conversation_id]
100 100
101 model = json_data.get('model')
102 model = model if model else models.default
103 patch = patch_provider if json_data.get('patch_provider') else None
101 model = json_data.get('model', models.default)
104 102
105 103 return {
106 104 "model": model,
@@ -108,7 +106,6 @@ class Api():
108 106 "messages": messages,
109 107 "stream": True,
110 108 "ignore_stream": True,
111 "patch_provider": patch,
112 109 "return_conversation": True,
113 110 **kwargs
114 111 }
@@ -161,7 +158,7 @@ class Api():
161 158 'type': response_type,
162 159 response_type: content
163 160 }
164
161
165 162 def get_error_message(exception: Exception) -> str:
166 163 """
167 164 Generates a formatted error message from an exception.