[Fix] Error Handling: Update setter methods to clarify None value handling and enhance authentication failure response policy.

This commit is contained in:
misyaguziya committed 2025-12-30 07:52:08 +09:00
1 parent 588b95eebe
commit 01061cf98f
3 files changed
+12 -6

No files matched your search

@@ -14,7 +14,7 @@ except Exception:
from translation_utils import loadTranslatePromptConfig
translation_lang = loadTranslationLanguages(path=".", force=True)
def _authentication_check(api_key: str, base_url: str | None = None) -> bool:
def _authentication_check(api_key: str) -> bool:
"""Check if the provided API key is valid by attempting to list models.
"""
@@ -94,7 +94,7 @@ class OpenRouterClient:
return self.api_key
def setAuthKey(self, api_key: str) -> bool:
result = _authentication_check(api_key, self.base_url)
result = _authentication_check(api_key)
if result:
self.api_key = api_key
return result