From 926ddfd5438ca06840bdff9b9bd21ddcd8863aa9 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Mon, 8 Apr 2024 07:24:00 +0200 Subject: Add WhiteRabbitNeo Provider, Many tiny improvments in the gui --- g4f/gui/server/api.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'g4f/gui/server/api.py') diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py index 7c09fdbe..2b3f2fb6 100644 --- a/g4f/gui/server/api.py +++ b/g4f/gui/server/api.py @@ -80,13 +80,12 @@ class Api(): Returns: dict: Arguments prepared for chat completion. """ - provider = json_data.get('provider', None) - if "image" in kwargs and provider is None: - provider = "Bing" - if provider == 'OpenaiChat': - kwargs['auto_continue'] = True - + model = json_data.get('model') or models.default + provider = json_data.get('provider') messages = json_data['messages'] + api_key = json_data.get("api_key") + if api_key is not None: + kwargs["api_key"] = api_key if json_data.get('web_search'): if provider == "Bing": kwargs['web_search'] = True @@ -98,8 +97,6 @@ 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') or models.default - return { "model": model, "provider": provider, -- cgit v1.2.3