fix: credentials validation of ababa (#2183)

This commit is contained in:
Yeuoly 2024-01-24 21:07:26 +08:00 committed by GitHub
parent ac4bb5c35f
commit dda32c6880
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ class MinimaxLargeLanguageModel(LargeLanguageModel):
stream=False,
user=''
)
except InvalidAuthenticationError as e:
except (InvalidAuthenticationError, InsufficientAccountBalanceError) as e:
raise CredentialsValidateFailedError(f"Invalid API key: {e}")
def get_num_tokens(self, model: str, credentials: dict, prompt_messages: list[PromptMessage],

View File

@ -27,4 +27,4 @@ class MinimaxProvider(ModelProvider):
raise ex
except Exception as ex:
logger.exception(f'{self.get_provider_schema().provider} credentials validate failed')
raise ex
raise CredentialsValidateFailedError(f'{ex}')