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:
hlohaus 2025-10-02 03:12:36 +02:00
parent 4399b432c4
commit f6309cb693
6 changed files with 1981 additions and 954 deletions

View file

@ -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)