浏览代码

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

takatost 1 年之前
父节点
当前提交
4cf475680d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      api/core/model_runtime/model_providers/baichuan/llm/llm.py

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