Show only free providers by default

This commit is contained in:
hlohaus
2025-02-21 06:52:04 +01:00
parent e53483d85b
commit 470b795418
14 changed files with 84 additions and 59 deletions

View File

@@ -143,7 +143,7 @@ class Api:
def decorated_log(text: str, file = None):
debug.logs.append(text)
if debug.logging:
debug.log_handler(text, file)
debug.log_handler(text, file=file)
debug.log = decorated_log
proxy = os.environ.get("G4F_PROXY")
provider = kwargs.get("provider")
@@ -187,7 +187,7 @@ class Api:
yield self._format_json("conversation_id", conversation_id)
elif isinstance(chunk, Exception):
logger.exception(chunk)
debug.error(e)
debug.error(chunk)
yield self._format_json('message', get_error_message(chunk), error=type(chunk).__name__)
elif isinstance(chunk, PreviewResponse):
yield self._format_json("preview", chunk.to_string())