From 95bab66dad89b6712bddbb4a20eb89d6cf5236b5 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Tue, 26 Mar 2024 06:42:47 +0100 Subject: No arkose token and .har files --- g4f/gui/server/api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'g4f/gui') diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py index 11b28dda..da934d57 100644 --- a/g4f/gui/server/api.py +++ b/g4f/gui/server/api.py @@ -39,9 +39,9 @@ from g4f.errors import VersionNotFoundError from g4f.Provider import ProviderType, __providers__, __map__ from g4f.providers.base_provider import ProviderModelMixin from g4f.Provider.bing.create_images import patch_provider -from g4f.Provider.Bing import Conversation +from g4f.providers.conversation import BaseConversation -conversations: dict[str, Conversation] = {} +conversations: dict[str, BaseConversation] = {} class Api(): @@ -230,14 +230,14 @@ class Api(): if first: first = False yield self._format_json("provider", get_last_provider(True)) - if isinstance(chunk, Conversation): + if isinstance(chunk, BaseConversation): conversations[conversation_id] = chunk yield self._format_json("conversation", conversation_id) elif isinstance(chunk, Exception): logging.exception(chunk) yield self._format_json("message", get_error_message(chunk)) else: - yield self._format_json("content", chunk) + yield self._format_json("content", str(chunk)) except Exception as e: logging.exception(e) yield self._format_json('error', get_error_message(e)) -- cgit v1.2.3