mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-12-25 12:16:17 +03:00
Update __init__.py
This commit is contained in:
parent
743fbc2a6c
commit
e41bbdce02
@ -51,6 +51,7 @@ class AppConfig():
|
|||||||
list_ignored_providers: Optional[list[str]] = None
|
list_ignored_providers: Optional[list[str]] = None
|
||||||
g4f_api_key: Optional[str] = None
|
g4f_api_key: Optional[str] = None
|
||||||
ignore_cookie_files: bool = False
|
ignore_cookie_files: bool = False
|
||||||
|
defaults: dict = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def set_config(cls, **data):
|
def set_config(cls, **data):
|
||||||
@ -145,7 +146,11 @@ class Api:
|
|||||||
if auth_header and auth_header != "Bearer":
|
if auth_header and auth_header != "Bearer":
|
||||||
config.api_key = auth_header
|
config.api_key = auth_header
|
||||||
response = self.client.chat.completions.create(
|
response = self.client.chat.completions.create(
|
||||||
**config.dict(exclude_none=True),
|
{
|
||||||
|
**AppConfig.defaults,
|
||||||
|
**config.dict(exclude_none=True),
|
||||||
|
},
|
||||||
|
|
||||||
ignored=AppConfig.list_ignored_providers
|
ignored=AppConfig.list_ignored_providers
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user