fix(vector): separate write transport fields

This commit is contained in:
2026-07-11 20:35:57 +02:00
parent ff4d662aba
commit fe8d70da47
6 changed files with 117 additions and 26 deletions
+18
View File
@@ -7,6 +7,16 @@ from tht.ports.dwh import (
DistinctValues,
UnsupportedCapability,
)
from tht.ports.vector import (
VectorCapabilities,
VectorHealth,
VectorHit,
VectorRecord,
VectorStore,
VectorStoreError,
VectorWriteRecord,
VectorWriteUnavailable,
)
__all__ = [
"DwhAdapter",
@@ -14,4 +24,12 @@ __all__ = [
"DwhHealth",
"DistinctValues",
"UnsupportedCapability",
"VectorCapabilities",
"VectorHealth",
"VectorHit",
"VectorRecord",
"VectorStore",
"VectorStoreError",
"VectorWriteRecord",
"VectorWriteUnavailable",
]
+11 -1
View File
@@ -20,6 +20,15 @@ class VectorHealth:
detail: str | None = None
@dataclass(frozen=True)
class VectorWriteRecord:
"""A canonical record plus transport-neutral, precomputed vector data."""
record: VectorRecord
embedding: list[float]
content_hash: str
class VectorStoreError(Exception):
"""Base error exposed by vector adapters."""
@@ -46,7 +55,7 @@ class VectorStore(Protocol):
def existing_hashes(self, collection: str, kinds: list[str]) -> dict[str, str]: ...
def upsert(self, collection: str, records: list[VectorRecord]) -> int: ...
def upsert(self, collection: str, records: list[VectorWriteRecord]) -> int: ...
__all__ = [
@@ -56,5 +65,6 @@ __all__ = [
"VectorRecord",
"VectorStore",
"VectorStoreError",
"VectorWriteRecord",
"VectorWriteUnavailable",
]