Use collection field from request when loading a knowledge core (#472)

* Use collection field from request when loading a knowledge core

* Test core collection
This commit is contained in:
cybermaggedon 2025-08-27 09:08:06 +01:00 committed by GitHub
parent e5b9b4976a
commit 3e5d6ed3e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 401 additions and 0 deletions

View file

@ -248,6 +248,9 @@ class KnowledgeManager:
await ge_pub.start()
async def publish_triples(t):
# Override collection with request collection
if hasattr(t, 'metadata') and hasattr(t.metadata, 'collection'):
t.metadata.collection = request.collection or "default"
await t_pub.send(None, t)
logger.debug("Publishing triples...")
@ -260,6 +263,9 @@ class KnowledgeManager:
)
async def publish_ge(g):
# Override collection with request collection
if hasattr(g, 'metadata') and hasattr(g.metadata, 'collection'):
g.metadata.collection = request.collection or "default"
await ge_pub.send(None, g)
logger.debug("Publishing graph embeddings...")