mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-07-19 16:00:23 +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
|
block_idx += 1
|
||||||
return "\n".join(post_lines)
|
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]:
|
def execute_modules(self, answer: str) -> Tuple[bool, str]:
|
||||||
"""
|
"""
|
||||||
Execute all the tools the agent has and return the result.
|
Execute all the tools the agent has and return the result.
|
||||||
@ -231,6 +239,7 @@ class Agent():
|
|||||||
|
|
||||||
if blocks != None:
|
if blocks != None:
|
||||||
for block in blocks:
|
for block in blocks:
|
||||||
|
self.show_block(block)
|
||||||
output = tool.execute([block])
|
output = tool.execute([block])
|
||||||
feedback = tool.interpreter_feedback(output) # tool interpreter feedback
|
feedback = tool.interpreter_feedback(output) # tool interpreter feedback
|
||||||
success = not tool.execution_failure_check(output)
|
success = not tool.execution_failure_check(output)
|
||||||
|
@ -56,6 +56,7 @@ class CoderAgent(Agent):
|
|||||||
self.last_answer = answer
|
self.last_answer = answer
|
||||||
await asyncio.sleep(0)
|
await asyncio.sleep(0)
|
||||||
break
|
break
|
||||||
|
self.show_answer()
|
||||||
animate_thinking("Executing code...", color="status")
|
animate_thinking("Executing code...", color="status")
|
||||||
self.status_message = "Executing code..."
|
self.status_message = "Executing code..."
|
||||||
exec_success, _ = self.execute_modules(answer)
|
exec_success, _ = self.execute_modules(answer)
|
||||||
@ -67,7 +68,6 @@ class CoderAgent(Agent):
|
|||||||
pretty_print("Execution failure", color="failure")
|
pretty_print("Execution failure", color="failure")
|
||||||
pretty_print("Correcting code...", color="status")
|
pretty_print("Correcting code...", color="status")
|
||||||
self.status_message = "Correcting code..."
|
self.status_message = "Correcting code..."
|
||||||
self.show_answer()
|
|
||||||
attempt += 1
|
attempt += 1
|
||||||
self.status_message = "Ready"
|
self.status_message = "Ready"
|
||||||
if attempt == max_attempts:
|
if attempt == max_attempts:
|
||||||
|
@ -70,7 +70,6 @@ class executorResult:
|
|||||||
}
|
}
|
||||||
|
|
||||||
def show(self):
|
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('▂'*64, color="status")
|
||||||
pretty_print(self.feedback, color="success" if self.success else "failure")
|
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