feat: add missing dependency hints for Gemini and Bedrock

This commit is contained in:
Paul Gauthier 2024-12-06 13:43:49 -08:00 committed by Paul Gauthier (aider)
parent f2d2ab51b1
commit 779983cb85
3 changed files with 16 additions and 5 deletions

View file

@ -78,4 +78,13 @@ class LiteLLMExceptions:
def get_ex_info(self, ex):
"""Return the ExInfo for a given exception instance"""
import litellm
if ex.__class__ is litellm.APIConnectionError:
if "google.auth" in str(ex):
return ExInfo(
"APIConnectionError", False, "You need to: pip install google-generativeai"
)
if "boto3" in str(ex):
return ExInfo("APIConnectionError", False, "You need to: pip install boto3")
return self.exceptions.get(ex.__class__, ExInfo(None, None, None))