Remove cruft

This commit is contained in:
Cyber MacGeddon 2024-11-09 20:33:10 +00:00
parent f75aca9ed1
commit 6d0fc3c89b
2 changed files with 5 additions and 17 deletions

View file

@ -94,8 +94,6 @@ Input:
t.tool.name for t in self.tools t.tool.name for t in self.tools
]) ])
print("HERE!")
prompt = tpl.render({ prompt = tpl.render({
"tools": tools, "tools": tools,
"question": question, "question": question,
@ -113,8 +111,6 @@ Input:
logger.info(f"prompt: {prompt}") logger.info(f"prompt: {prompt}")
print(prompt)
resp = self.context.prompt.request( resp = self.context.prompt.request(
"question", "question",
{ {
@ -154,8 +150,6 @@ Input:
act = self.reason(question, history) act = self.reason(question, history)
logger.info(f"act: {act}") logger.info(f"act: {act}")
print(act)
if isinstance(act, Final): if isinstance(act, Final):
think(act.thought) think(act.thought)
@ -174,8 +168,6 @@ Input:
if action is None: if action is None:
raise RuntimeError(f"No action for {act.name}!") raise RuntimeError(f"No action for {act.name}!")
print(act.arguments)
print("Invoke...")
resp = action.invoke(**act.arguments) resp = action.invoke(**act.arguments)
resp = resp.strip() resp = resp.strip()

View file

@ -139,16 +139,16 @@ class Processor(ConsumerProducer):
else: else:
history = [] history = []
print(v.question) print(f"Question: {v.question}", flush=True)
if len(history) > 10: if len(history) > 10:
raise RuntimeError("Too many agent iterations") raise RuntimeError("Too many agent iterations")
print("History:", history) print(f"History: {history}", flush=True)
def think(x): def think(x):
print("THINK:", x) print(f"Think: {x}", flush=True)
r = AgentResponse( r = AgentResponse(
answer=None, answer=None,
@ -161,7 +161,7 @@ class Processor(ConsumerProducer):
def observe(x): def observe(x):
print("OBSERVE:", x) print(f"Observe: {x}", flush=True)
r = AgentResponse( r = AgentResponse(
answer=None, answer=None,
@ -174,14 +174,12 @@ class Processor(ConsumerProducer):
act = self.agent.react(v.question, history, think, observe) act = self.agent.react(v.question, history, think, observe)
print(act) print(f"Action: {act}", flush=True)
print("Send response...", flush=True) print("Send response...", flush=True)
if type(act) == Final: if type(act) == Final:
print("Send response...", flush=True)
r = AgentResponse( r = AgentResponse(
answer=act.final, answer=act.final,
error=None, error=None,
@ -196,8 +194,6 @@ class Processor(ConsumerProducer):
history.append(act) history.append(act)
print(history)
r = AgentRequest( r = AgentRequest(
question=v.question, question=v.question,
plan=v.plan, plan=v.plan,