[MistralAI] Improve MistralAIEmbeddings (#29242)

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

#29125
This commit is contained in:
ZhangShenao 2025-02-06 10:31:54 +08:00 committed by GitHub
parent 22aa5e07ed
commit ac53977dbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -224,7 +224,9 @@ class MistralAIEmbeddings(BaseModel, Embeddings):
batch_responses = [] batch_responses = []
@retry( @retry(
retry=retry_if_exception_type(httpx.TimeoutException), retry=retry_if_exception_type(
(httpx.TimeoutException, httpx.HTTPStatusError)
),
wait=wait_fixed(self.wait_time), wait=wait_fixed(self.wait_time),
stop=stop_after_attempt(self.max_retries), stop=stop_after_attempt(self.max_retries),
) )