fix: enforce internal embeddings contract

This commit is contained in:
2026-08-08 17:33:19 +02:00
parent 2911e008d1
commit c875fa52ce
5 changed files with 131 additions and 3 deletions
+17
View File
@@ -137,3 +137,20 @@ def test_internal_embeddings_reject_non_finite_values():
with pytest.raises(EmbeddingsError, match="finite|finit"):
embedder.embed(["alpha"])
def test_internal_embeddings_reject_non_object_json_payload():
from tht.vectorstore.embeddings import OllamaInternalEmbeddings
embedder = OllamaInternalEmbeddings(
EmbeddingsConfig(
provider="ollama_internal",
base_url="http://embedding:11434",
model="qwen3-embedding:0.6b",
dim=1024,
),
session=_Session([_Response([_vector(1.0)])]),
)
with pytest.raises(EmbeddingsError, match="response|payload|embeddings"):
embedder.embed(["alpha"])