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

This commit is contained in:
takatost 2024-02-19 11:52:52 +08:00 committed by GitHub
parent ca4aa340f6
commit 4cf475680d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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