From 4cf475680db459f985201678b156bb2439f248d2 Mon Sep 17 00:00:00 2001 From: takatost Date: Mon, 19 Feb 2024 11:52:52 +0800 Subject: [PATCH] fix: credential verification of baichuan did not throw all errors (#2475) --- api/core/model_runtime/model_providers/baichuan/llm/llm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/core/model_runtime/model_providers/baichuan/llm/llm.py b/api/core/model_runtime/model_providers/baichuan/llm/llm.py index 707355fa7a..4278120093 100644 --- a/api/core/model_runtime/model_providers/baichuan/llm/llm.py +++ b/api/core/model_runtime/model_providers/baichuan/llm/llm.py @@ -103,7 +103,7 @@ class BaichuanLarguageModel(LargeLanguageModel): ], parameters={ 'max_tokens': 1, }, timeout=60) - except (InvalidAPIKeyError, InvalidAuthenticationError) as e: + except Exception as e: raise CredentialsValidateFailedError(f"Invalid API key: {e}") def _generate(self, model: str, credentials: dict, prompt_messages: list[PromptMessage],