fix: enforce internal embeddings contract
This commit is contained in:
@@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user