diff --git a/trustgraph-flow/trustgraph/agent/react/agent_manager.py b/trustgraph-flow/trustgraph/agent/react/agent_manager.py index 6d292e11..094b329b 100644 --- a/trustgraph-flow/trustgraph/agent/react/agent_manager.py +++ b/trustgraph-flow/trustgraph/agent/react/agent_manager.py @@ -94,8 +94,6 @@ Input: t.tool.name for t in self.tools ]) - print("HERE!") - prompt = tpl.render({ "tools": tools, "question": question, @@ -113,8 +111,6 @@ Input: logger.info(f"prompt: {prompt}") - print(prompt) - resp = self.context.prompt.request( "question", { @@ -154,8 +150,6 @@ Input: act = self.reason(question, history) logger.info(f"act: {act}") - print(act) - if isinstance(act, Final): think(act.thought) @@ -174,8 +168,6 @@ Input: if action is None: raise RuntimeError(f"No action for {act.name}!") - print(act.arguments) - print("Invoke...") resp = action.invoke(**act.arguments) resp = resp.strip() diff --git a/trustgraph-flow/trustgraph/agent/react/service.py b/trustgraph-flow/trustgraph/agent/react/service.py index db93e3b7..0477552d 100755 --- a/trustgraph-flow/trustgraph/agent/react/service.py +++ b/trustgraph-flow/trustgraph/agent/react/service.py @@ -139,16 +139,16 @@ class Processor(ConsumerProducer): else: history = [] - print(v.question) + print(f"Question: {v.question}", flush=True) if len(history) > 10: raise RuntimeError("Too many agent iterations") - print("History:", history) + print(f"History: {history}", flush=True) def think(x): - print("THINK:", x) + print(f"Think: {x}", flush=True) r = AgentResponse( answer=None, @@ -161,7 +161,7 @@ class Processor(ConsumerProducer): def observe(x): - print("OBSERVE:", x) + print(f"Observe: {x}", flush=True) r = AgentResponse( answer=None, @@ -174,14 +174,12 @@ class Processor(ConsumerProducer): act = self.agent.react(v.question, history, think, observe) - print(act) + print(f"Action: {act}", flush=True) print("Send response...", flush=True) if type(act) == Final: - print("Send response...", flush=True) - r = AgentResponse( answer=act.final, error=None, @@ -196,8 +194,6 @@ class Processor(ConsumerProducer): history.append(act) - print(history) - r = AgentRequest( question=v.question, plan=v.plan,