From 30bc6f15da1a5c10a782e5c22c38e76bfaef0d5a Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Sat, 9 Nov 2024 11:20:58 +0000 Subject: [PATCH] Logging observations --- agent/plan-b-4 | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/agent/plan-b-4 b/agent/plan-b-4 index e875aa13..04d25dbe 100755 --- a/agent/plan-b-4 +++ b/agent/plan-b-4 @@ -12,7 +12,7 @@ import base64 import logging logger = logging.getLogger(__name__) -logging.basicConfig(level=logging.INFO) +#logging.basicConfig(level=logging.INFO) def wrap(text, width=75): @@ -265,6 +265,13 @@ Input: output(wrap(thought), "? ") print() + def observe(self, observation): + + logger.info(f"observe: {observation}") + + output(wrap(observation), "! ") + print() + def invoke(self): for i in range(0, 10): @@ -296,6 +303,8 @@ Input: logger.info(f"resp: {resp}") + self.observe(resp) + act.observation = resp logger.info(f"iter: {act}") @@ -305,7 +314,9 @@ Input: raise RuntimeError("Too many iterations") -q = "How many cats does Mark have? Calculate that number raised to 0.4 power. Is that number higher than the numeric part of the mission identifier of the Space Shuttle Challenger on its last mission? If so, give me an apple pie recipe, otherwise return a poem about cheese." +q = "How many cats does Mark have? Calculate that number raised to 0.4 power. Is that number lower than the numeric part of the mission identifier of the Space Shuttle Challenger on its last mission? If so, give me an apple pie recipe, otherwise return a poem about cheese." + +logger.info(f"q: {q}") output(wrap(q)) print() @@ -314,6 +325,8 @@ am = AgentManager(prompt_client, tools, q) resp = am.invoke() +logger.info(f"answer: {resp}") + output(resp, "< ") print()