mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-20 18:51:03 +02:00
Remove cruft
This commit is contained in:
parent
f75aca9ed1
commit
6d0fc3c89b
2 changed files with 5 additions and 17 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue