mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
feat(mistralai): remove tenacity retries for embeddings (#33491)
This commit is contained in:
@@ -35,7 +35,7 @@ async def test_mistralai_embedding_documents_async() -> None:
|
||||
assert len(output[0]) == 1024
|
||||
|
||||
|
||||
async def test_mistralai_embedding_documents_http_error_async() -> None:
|
||||
async def test_mistralai_embedding_documents_tenacity_error_async() -> None:
|
||||
"""Test MistralAI embeddings for documents."""
|
||||
documents = ["foo bar", "test document"]
|
||||
embedding = MistralAIEmbeddings(max_retries=0)
|
||||
@@ -50,6 +50,21 @@ async def test_mistralai_embedding_documents_http_error_async() -> None:
|
||||
await embedding.aembed_documents(documents)
|
||||
|
||||
|
||||
async def test_mistralai_embedding_documents_http_error_async() -> None:
|
||||
"""Test MistralAI embeddings for documents."""
|
||||
documents = ["foo bar", "test document"]
|
||||
embedding = MistralAIEmbeddings(max_retries=None)
|
||||
mock_response = httpx.Response(
|
||||
status_code=400,
|
||||
request=httpx.Request("POST", url=embedding.async_client.base_url),
|
||||
)
|
||||
with (
|
||||
patch.object(embedding.async_client, "post", return_value=mock_response),
|
||||
pytest.raises(httpx.HTTPStatusError),
|
||||
):
|
||||
await embedding.aembed_documents(documents)
|
||||
|
||||
|
||||
async def test_mistralai_embedding_query_async() -> None:
|
||||
"""Test MistralAI embeddings for query."""
|
||||
document = "foo bar"
|
||||
|
||||
Reference in New Issue
Block a user