From 9a36af85f8e0a6eefe5de8e7201b0773203816c5 Mon Sep 17 00:00:00 2001 From: rayan-sharma-git Date: Sat, 19 Sep 2026 19:02:17 +0530 Subject: [PATCH 1/2] Fix empty Anthropic API key detection Changed the API key check from: if self.api_key is not None: to: if self.api_key: The previous check considered an empty API key as valid because an empty string is not None. The new check only considers the provider available when an actual API key is provided. --- ai/providers/anthropic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ai/providers/anthropic.py b/ai/providers/anthropic.py index d961e69..7d0df54 100644 --- a/ai/providers/anthropic.py +++ b/ai/providers/anthropic.py @@ -43,7 +43,7 @@ def set_model(self, model_name: str): self.current_model = model_name def get_models(self) -> dict: - if self.api_key is not None: + if self.api_key: return self.MODELS else: return {} From 978d8728d75e86867524220277a15c8dcd739e30 Mon Sep 17 00:00:00 2001 From: rayan-sharma-git Date: Sat, 19 Sep 2026 19:06:04 +0530 Subject: [PATCH 2/2] Fix empty OpenAI API key detection Changed the API key check from: if self.api_key is not None: to: if self.api_key: The previous check treated an empty API key as valid. The new check only considers the OpenAI provider available when an API key is actually provided. --- ai/providers/openai.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ai/providers/openai.py b/ai/providers/openai.py index 927c90e..fba886a 100644 --- a/ai/providers/openai.py +++ b/ai/providers/openai.py @@ -35,7 +35,7 @@ def set_model(self, model_name: str): self.current_model = model_name def get_models(self) -> dict: - if self.api_key is not None: + if self.api_key: return self.MODELS else: return {}