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()