mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Refactor OpenaiTemplate to remove API key print statement; update model providers by removing Blackbox references; enhance error handling in raise_for_status_async to handle JSON decoding errors gracefully.
This commit is contained in:
parent
4399b432c4
commit
f6309cb693
6 changed files with 1981 additions and 954 deletions
|
|
@ -41,7 +41,6 @@ class OpenaiTemplate(AsyncGeneratorProvider, ProviderModelMixin, RaiseErrorMixin
|
|||
api_key = cls.api_key
|
||||
if not api_key:
|
||||
api_key = AuthManager.load_api_key(cls)
|
||||
print(f"API Key: {api_key}")
|
||||
if cls.models_needs_auth and not api_key:
|
||||
raise MissingAuthError('Add a "api_key"')
|
||||
response = requests.get(f"{api_base}/models", headers=cls.get_headers(False, api_key), verify=cls.ssl)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue