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))

View file

@ -50,7 +50,7 @@ pip install boto3
To use aider installed via `pipx` with AWS Bedrock, you must add the `boto3` dependency to aider's virtual environment by running
```bash
pipx inject aider boto3
pipx inject aider-chat boto3
```

View file

@ -5,15 +5,17 @@ nav_order: 300
# Gemini
Google currently offers
[*free* API access to the Gemini 1.5 Pro model](https://ai.google.dev/pricing).
This is the most capable free model to use with aider,
with code editing capability that's comparable to GPT-3.5.
You'll need a [Gemini API key](https://aistudio.google.com/app/u/2/apikey).
```
python -m pip install -U aider-chat
# You may need to install google-generativeai
pip install -U google-generativeai
# Or with pipx...
pipx inject aider-chat google-generativeai
export GEMINI_API_KEY=<key> # Mac/Linux
setx GEMINI_API_KEY <key> # Windows, restart shell after setx