diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-05-06 16:42:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-06 16:42:56 +0200 |
commit | e41bbdce02e87f3e2844bdd91ab148124619fda6 (patch) | |
tree | adcb0274a8985966fe372ff1b2bdbf6f374dfe8e /g4f | |
parent | Update __init__.py (diff) | |
download | gpt4free-e41bbdce02e87f3e2844bdd91ab148124619fda6.tar gpt4free-e41bbdce02e87f3e2844bdd91ab148124619fda6.tar.gz gpt4free-e41bbdce02e87f3e2844bdd91ab148124619fda6.tar.bz2 gpt4free-e41bbdce02e87f3e2844bdd91ab148124619fda6.tar.lz gpt4free-e41bbdce02e87f3e2844bdd91ab148124619fda6.tar.xz gpt4free-e41bbdce02e87f3e2844bdd91ab148124619fda6.tar.zst gpt4free-e41bbdce02e87f3e2844bdd91ab148124619fda6.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/api/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/g4f/api/__init__.py b/g4f/api/__init__.py index f1374dc9..3972c079 100644 --- a/g4f/api/__init__.py +++ b/g4f/api/__init__.py @@ -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( - **config.dict(exclude_none=True), + { + **AppConfig.defaults, + **config.dict(exclude_none=True), + }, + ignored=AppConfig.list_ignored_providers ) except Exception as e: |