mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
Knowledge core processing updated for embeddings interface change (#681)
Knowledge core fixed:
- trustgraph-flow/trustgraph/tables/knowledge.py - v.vector, v.chunk_id
- trustgraph-base/trustgraph/messaging/translators/document_loading.py -
chunk.vector
- trustgraph-base/trustgraph/messaging/translators/knowledge.py -
entity.vector
- trustgraph-flow/trustgraph/gateway/dispatch/serialize.py - entity.vector,
chunk.vector
Test fixtures fixed:
- tests/unit/test_storage/conftest.py - All mock entities/chunks use vector
- tests/unit/test_query/conftest.py - All mock requests use vector
- tests/unit/test_query/test_doc_embeddings_pinecone_query.py - All mock
messages use vector
These changes align with commit f2ae0e86 which changed the schema from
vectors: list[list[float]] to vector: list[float].
This commit is contained in:
parent
84941ce645
commit
57eda65674
7 changed files with 32 additions and 46 deletions
|
|
@ -169,7 +169,7 @@ class DocumentEmbeddingsTranslator(SendTranslator):
|
|||
"chunks": [
|
||||
{
|
||||
"chunk_id": chunk.chunk_id,
|
||||
"vectors": chunk.vectors
|
||||
"vector": chunk.vector
|
||||
}
|
||||
for chunk in obj.chunks
|
||||
]
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class KnowledgeRequestTranslator(MessageTranslator):
|
|||
},
|
||||
"entities": [
|
||||
{
|
||||
"vectors": entity.vectors,
|
||||
"vector": entity.vector,
|
||||
"entity": self.value_translator.from_pulsar(entity.entity),
|
||||
}
|
||||
for entity in obj.graph_embeddings.entities
|
||||
|
|
@ -154,7 +154,7 @@ class KnowledgeResponseTranslator(MessageTranslator):
|
|||
},
|
||||
"entities": [
|
||||
{
|
||||
"vectors": entity.vectors,
|
||||
"vector": entity.vector,
|
||||
"entity": self.value_translator.from_pulsar(entity.entity),
|
||||
}
|
||||
for entity in obj.graph_embeddings.entities
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue