mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-07-18 23:40:39 +00:00
fix : was showing code after execution
This commit is contained in:
parent
f09cb8a7b5
commit
45700d77ab
@ -214,6 +214,14 @@ class Agent():
|
||||
block_idx += 1
|
||||
return "\n".join(post_lines)
|
||||
|
||||
def show_block(self, block: str) -> None:
|
||||
"""
|
||||
Show the block in a pretty way.
|
||||
"""
|
||||
pretty_print('▂'*64, color="status")
|
||||
pretty_print(block, color="code")
|
||||
pretty_print('▂'*64, color="status")
|
||||
|
||||
def execute_modules(self, answer: str) -> Tuple[bool, str]:
|
||||
"""
|
||||
Execute all the tools the agent has and return the result.
|
||||
@ -231,6 +239,7 @@ class Agent():
|
||||
|
||||
if blocks != None:
|
||||
for block in blocks:
|
||||
self.show_block(block)
|
||||
output = tool.execute([block])
|
||||
feedback = tool.interpreter_feedback(output) # tool interpreter feedback
|
||||
success = not tool.execution_failure_check(output)
|
||||
|
@ -56,6 +56,7 @@ class CoderAgent(Agent):
|
||||
self.last_answer = answer
|
||||
await asyncio.sleep(0)
|
||||
break
|
||||
self.show_answer()
|
||||
animate_thinking("Executing code...", color="status")
|
||||
self.status_message = "Executing code..."
|
||||
exec_success, _ = self.execute_modules(answer)
|
||||
@ -67,7 +68,6 @@ class CoderAgent(Agent):
|
||||
pretty_print("Execution failure", color="failure")
|
||||
pretty_print("Correcting code...", color="status")
|
||||
self.status_message = "Correcting code..."
|
||||
self.show_answer()
|
||||
attempt += 1
|
||||
self.status_message = "Ready"
|
||||
if attempt == max_attempts:
|
||||
|
@ -70,7 +70,6 @@ class executorResult:
|
||||
}
|
||||
|
||||
def show(self):
|
||||
pretty_print('▂'*64, color="status")
|
||||
pretty_print(self.block, color="code" if self.success else "failure")
|
||||
pretty_print('▂'*64, color="status")
|
||||
pretty_print(self.feedback, color="success" if self.success else "failure")
|
||||
pretty_print('▂'*64, color="status")
|
Loading…
x
Reference in New Issue
Block a user