mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
test(s3-vectors): isolate dimension autodetect assertion
This commit is contained in:
parent
d667fe7fca
commit
49b7dabd82
1 changed files with 14 additions and 7 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from types import SimpleNamespace
|
||||
from unittest.mock import AsyncMock, call, patch
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
|
@ -36,15 +36,22 @@ async def test_s3_vectors_ingestion_uses_vector_store_embedding_model():
|
|||
)
|
||||
|
||||
embeddings = await ingestion.embed(["hello"])
|
||||
|
||||
mock_aembedding.assert_awaited_once_with(
|
||||
model="text-embedding-3-large", input=["hello"]
|
||||
)
|
||||
assert embeddings == [[0.1, 0.2, 0.3]]
|
||||
|
||||
mock_aembedding.reset_mock()
|
||||
mock_aembedding.return_value = SimpleNamespace(
|
||||
data=[{"embedding": [0.1, 0.2, 0.3]}]
|
||||
)
|
||||
|
||||
dimension = await ingestion._get_dimension_from_embedding_request()
|
||||
|
||||
mock_aembedding.assert_has_awaits(
|
||||
[
|
||||
call(model="text-embedding-3-large", input=["hello"]),
|
||||
call(model="text-embedding-3-large", input=["test"]),
|
||||
]
|
||||
mock_aembedding.assert_awaited_once_with(
|
||||
model="text-embedding-3-large", input=["test"]
|
||||
)
|
||||
assert embeddings == [[0.1, 0.2, 0.3]]
|
||||
assert dimension == 3
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue