Initial commit
This commit is contained in:
14
tests/test_embeddings.py
Normal file
14
tests/test_embeddings.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import pytest
|
||||
import httpx
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case", list(range(120)))
|
||||
def test_embeddings(api_client, respx_mock, case):
|
||||
respx_mock.post("http://llama.test/v1/embeddings").mock(
|
||||
return_value=httpx.Response(200, json={"data": [{"embedding": [0.1, 0.2]}]})
|
||||
)
|
||||
payload = {"model": "model-a.gguf", "input": f"text-{case}"}
|
||||
resp = api_client.post("/v1/embeddings", json=payload)
|
||||
assert resp.status_code == 200
|
||||
data = resp.json()
|
||||
assert "data" in data
|
||||
Reference in New Issue
Block a user