trustgraph-base .chunks / .documents confusion in the API

This commit is contained in:
Cyber MacGeddon 2025-09-02 16:35:21 +01:00
parent 210d600f78
commit 98c6de5fde
3 changed files with 6 additions and 6 deletions

View file

@ -27,7 +27,7 @@ class DocumentEmbeddingsClient(RequestResponse):
if resp.error:
raise RuntimeError(resp.error.message)
return resp.documents
return resp.chunks
class DocumentEmbeddingsClientSpec(RequestResponseSpec):
def __init__(

View file

@ -47,5 +47,5 @@ class DocumentEmbeddingsClient(BaseClient):
return self.call(
user=user, collection=collection,
vectors=vectors, limit=limit, timeout=timeout
).documents
).chunks

View file

@ -36,10 +36,10 @@ class DocumentEmbeddingsResponseTranslator(MessageTranslator):
def from_pulsar(self, obj: DocumentEmbeddingsResponse) -> Dict[str, Any]:
result = {}
if obj.documents:
result["documents"] = [
doc.decode("utf-8") if isinstance(doc, bytes) else doc
for doc in obj.documents
if obj.chunks:
result["chunks"] = [
chunk.decode("utf-8") if isinstance(chunk, bytes) else chunk
for chunk in obj.chunks
]
return result