summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-04-06 17:22:11 +0200
committerGitHub <noreply@github.com>2024-04-06 17:22:11 +0200
commita9f16aea69d26a21d715b84be50ab95da338592e (patch)
tree02aecb5caa8facc5ba4d23bff30a69e34c39b6e5 /g4f
parentUpdate api.py (diff)
downloadgpt4free-a9f16aea69d26a21d715b84be50ab95da338592e.tar
gpt4free-a9f16aea69d26a21d715b84be50ab95da338592e.tar.gz
gpt4free-a9f16aea69d26a21d715b84be50ab95da338592e.tar.bz2
gpt4free-a9f16aea69d26a21d715b84be50ab95da338592e.tar.lz
gpt4free-a9f16aea69d26a21d715b84be50ab95da338592e.tar.xz
gpt4free-a9f16aea69d26a21d715b84be50ab95da338592e.tar.zst
gpt4free-a9f16aea69d26a21d715b84be50ab95da338592e.zip
Diffstat (limited to '')
-rw-r--r--g4f/gui/server/api.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py
index 896ecde5..2c6279d1 100644
--- a/g4f/gui/server/api.py
+++ b/g4f/gui/server/api.py
@@ -98,9 +98,7 @@ class Api():
if conversation_id and provider in conversations and conversation_id in conversations[provider]:
kwargs["conversation"] = conversations[provider][conversation_id]
- model = json_data.get('model')
- model = model if model else models.default
- patch = patch_provider if json_data.get('patch_provider') else None
+ model = json_data.get('model', models.default)
return {
"model": model,
@@ -108,7 +106,6 @@ class Api():
"messages": messages,
"stream": True,
"ignore_stream": True,
- "patch_provider": patch,
"return_conversation": True,
**kwargs
}
@@ -161,7 +158,7 @@ class Api():
'type': response_type,
response_type: content
}
-
+
def get_error_message(exception: Exception) -> str:
"""
Generates a formatted error message from an exception.