Просмотр исходного кода

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

takatost 1 год назад
Родитель
Сommit
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],