Update __init__.py

This commit is contained in:
H Lohaus 2024-05-06 16:42:56 +02:00 committed by GitHub
parent 743fbc2a6c
commit e41bbdce02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,6 +51,7 @@ class AppConfig():
list_ignored_providers: Optional[list[str]] = None
g4f_api_key: Optional[str] = None
ignore_cookie_files: bool = False
defaults: dict = {}
@classmethod
def set_config(cls, **data):
@ -145,7 +146,11 @@ class Api:
if auth_header and auth_header != "Bearer":
config.api_key = auth_header
response = self.client.chat.completions.create(
{
**AppConfig.defaults,
**config.dict(exclude_none=True),
},
ignored=AppConfig.list_ignored_providers
)
except Exception as e: