mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-28 01:46:22 +02:00
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:
parent
28190fea8a
commit
6e9e2a11b1
3 changed files with 135 additions and 5 deletions
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue