Jelajahi Sumber

fix: credential verification of baichuan did not throw all errors (#2475)

takatost 1 tahun lalu
induk
melakukan
4cf475680d

+ 1 - 1
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],