Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Improve exception mapping #1776

Merged
merged 7 commits into from
Feb 2, 2024
Merged

Conversation

ishaan-jaff
Copy link
Contributor

@ishaan-jaff ishaan-jaff commented Feb 2, 2024

Better Exceptions for OpenAI compatible providers - You can see the provider name in the exception

  • Perplexity AI API
  • Mistral API
  • Anyscale
  • Xinference Embeddings
  • Voyage AI Embeddings
exception:  PerplexityException - Traceback (most recent call last):
  File "/Users/ishaanjaffer/Github/litellm/litellm/llms/perplexity.py", line 349, in completion
    raise e
  File "/Users/ishaanjaffer/Github/litellm/litellm/llms/perplexity.py", line 292, in completion
    perplexity_client = perplexity(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/perplexity/_client.py", line 98, in __init__
    raise perplexityError(
perplexity.perplexityError: The api_key client option must be set either by passing api_key to the client or by setting the PERPLEXITY_API_KEY environment variable

Copy link

railway-app bot commented Feb 2, 2024

This PR is being deployed to Railway 🚅

litellm: ◻️ REMOVED

Copy link

vercel bot commented Feb 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2024 8:46pm
litellm-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2024 8:46pm

@ishaan-jaff
Copy link
Contributor Author

@dhruv-anand-aintech added a test for the exact error you were seeing

@dhruv-anand-aintech
Copy link
Contributor

That's awesome. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants