Unverified Commit 4cf47568 authored by takatost's avatar takatost Committed by GitHub

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

parent ca4aa340
...@@ -103,7 +103,7 @@ class BaichuanLarguageModel(LargeLanguageModel): ...@@ -103,7 +103,7 @@ class BaichuanLarguageModel(LargeLanguageModel):
], parameters={ ], parameters={
'max_tokens': 1, 'max_tokens': 1,
}, timeout=60) }, timeout=60)
except (InvalidAPIKeyError, InvalidAuthenticationError) as e: except Exception as e:
raise CredentialsValidateFailedError(f"Invalid API key: {e}") raise CredentialsValidateFailedError(f"Invalid API key: {e}")
def _generate(self, model: str, credentials: dict, prompt_messages: list[PromptMessage], def _generate(self, model: str, credentials: dict, prompt_messages: list[PromptMessage],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment