Fix knowledge query ignoring the collection (#467)

* Fix knowledge query ignoring the collection

* Updated the agent_manager.py to properly pass config parameters when instantiating tool implementations

* Added tests for agent collection parameter
This commit is contained in:
cybermaggedon 2025-08-26 19:05:48 +01:00 committed by GitHub
parent 28190fea8a
commit 6e9e2a11b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 135 additions and 5 deletions

View file

@ -269,7 +269,13 @@ class AgentManager:
logger.debug(f"TOOL>>> {act}")
resp = await action.implementation(context).invoke(
# Instantiate the tool implementation with context and config
if action.config:
tool_instance = action.implementation(context, **action.config)
else:
tool_instance = action.implementation(context)
resp = await tool_instance.invoke(
**act.arguments
)

View file

@ -27,7 +27,8 @@ class KnowledgeQueryImpl:
client = self.context("graph-rag-request")
logger.debug("Graph RAG question...")
return await client.rag(
arguments.get("question")
arguments.get("question"),
collection=self.collection if self.collection else "default"
)
# This tool implementation knows how to do text completion. This uses