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

[MistralAI] Improve MistralAIEmbeddings #29242

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ZhangShenao
Copy link
Contributor

  • Add static method decorator for method.
  • Add expected exception for retry decorator

#29125

Copy link

vercel bot commented Jan 16, 2025

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jan 17, 2025 2:32am

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. Ɑ: embeddings Related to text embedding models module labels Jan 16, 2025
@@ -223,7 +224,9 @@ def embed_documents(self, texts: List[str]) -> List[List[float]]:
batch_responses = []

@retry(
retry=retry_if_exception_type(httpx.TimeoutException),
retry=retry_if_exception_type(
(httpx.TimeoutException, httpx.HTTPStatusError)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will any other error codes raise HTTPStatusError?

Httpx docs say "4xx or 5xx". Can we catch 429 errors specifically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The httpx library does not provide an exception definition for TooManyRequests, which is included in the HTTPStatus Error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ɑ: embeddings Related to text embedding models module size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

2 participants