Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/microbots/MicroBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ def run(

while llm_response.task_done is False:
logger.info("%s Step-%d %s", "-" * 20, iteration_count, "-" * 20)
if llm_response.thoughts:
logger.info(
f" 💭 LLM thoughts: {LogTextColor.OKCYAN}{llm_response.thoughts}{LogTextColor.ENDC}",
)
logger.info(
f" ➡️ LLM tool call : {LogTextColor.OKBLUE}{json.dumps(llm_response.command)}{LogTextColor.ENDC}",
)
Expand Down Expand Up @@ -222,8 +226,8 @@ def run(

llm_command_output = self.environment.execute(llm_response.command)

logger.info(
" ⬅️ Command executed.\nReturn Code: %d\nStdout:\n%s\nStderr:\n%s",
logger.debug(
" 🔧 Command executed.\nReturn Code: %d\nStdout:\n%s\nStderr:\n%s",
llm_command_output.return_code,
llm_command_output.stdout,
llm_command_output.stderr,
Expand All @@ -237,9 +241,13 @@ def run(
else:
output_text = f"COMMAND EXECUTION FAILED\nreturn code: {llm_command_output.return_code}\nstdout: {llm_command_output.stdout}\nstderr: {llm_command_output.stderr}"

logger.info("📨 Message to LLM:\n%s", output_text)
logger.info(" ⬅️ Command output:\n%s", output_text)
llm_response = self.llm.ask(output_text)

if llm_response.thoughts:
logger.info(
f" 💭 LLM final thoughts: {LogTextColor.OKCYAN}{llm_response.thoughts}{LogTextColor.ENDC}",
)
logger.info("🔚 TASK COMPLETED : %s...", task[0:15])
return BotRunResult(status=True, result=llm_response.thoughts, error=None)

Expand Down
Loading