trustgraph/trustgraph-flow/trustgraph/agent/react/tools.py
cybermaggedon 2aa0586d38
Agent tweak (#271)
- Removed unused LLM client configuration from agent-manager-react
- Change agent-manager-react template to use prompt-rag instead of
  prompt
- Changed TextCompletion tool to use 'question' instead of 'computation'
  for its parameter.
2025-01-20 14:04:48 +00:00

19 lines
667 B
Python

# This tool implementation knows how to put a question to the graph RAG
# service
class KnowledgeQueryImpl:
def __init__(self, context):
self.context = context
def invoke(self, **arguments):
return self.context.graph_rag.request(arguments.get("query"))
# This tool implementation knows how to do text completion. This uses
# the prompt service, rather than talking to TextCompletion directly.
class TextCompletionImpl:
def __init__(self, context):
self.context = context
def invoke(self, **arguments):
return self.context.prompt.request(
"question", { "question": arguments.get("question") }
)