mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-25 23:35:12 +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
|
|
@ -54,7 +54,7 @@ def serialize_graph_embeddings(message):
|
|||
},
|
||||
"entities": [
|
||||
{
|
||||
"vectors": entity.vectors,
|
||||
"vector": entity.vector,
|
||||
"entity": serialize_value(entity.entity),
|
||||
}
|
||||
for entity in message.entities
|
||||
|
|
@ -88,7 +88,7 @@ def serialize_document_embeddings(message):
|
|||
},
|
||||
"chunks": [
|
||||
{
|
||||
"vectors": chunk.vectors,
|
||||
"vector": chunk.vector,
|
||||
"chunk_id": chunk.chunk_id,
|
||||
}
|
||||
for chunk in message.chunks
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ class KnowledgeTableStore:
|
|||
entities = [
|
||||
(
|
||||
term_to_tuple(v.entity),
|
||||
v.vectors
|
||||
v.vector
|
||||
)
|
||||
for v in m.entities
|
||||
]
|
||||
|
|
@ -313,8 +313,8 @@ class KnowledgeTableStore:
|
|||
|
||||
chunks = [
|
||||
(
|
||||
v.chunk,
|
||||
v.vectors,
|
||||
v.chunk_id,
|
||||
v.vector,
|
||||
)
|
||||
for v in m.chunks
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue