Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more consistent message notices to FCM #132

Merged
merged 6 commits into from
Jun 5, 2024
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
15 changes: 10 additions & 5 deletions esbmc_ai/commands/fix_code_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
)
from ..logging import print_horizontal_line, printv, printvv

# TODO Remove built in messages and move them to config.


class FixCodeCommand(ChatCommand):
on_solution_signal: Signal = Signal()
Expand Down Expand Up @@ -135,7 +133,7 @@ def print_raw_conversation() -> None:
break

# Print verbose lvl 2
printvv("\nGeneration:")
printvv("\nESBMC-AI Notice: Source Code Generation:")
print_horizontal_line(2)
printvv(source_code)
print_horizontal_line(2)
Expand All @@ -154,6 +152,7 @@ def print_raw_conversation() -> None:
self.anim.stop()

# Print verbose lvl 2
printvv("\nESBMC-AI Notice: ESBMC Output:")
print_horizontal_line(2)
printvv(esbmc_output)
print_horizontal_line(2)
Expand All @@ -173,11 +172,17 @@ def print_raw_conversation() -> None:
# Update state
solution_generator.update_state(source_code, esbmc_output)
except ESBMCTimedOutException:
print("error: ESBMC has timed out...")
if config.raw_conversation:
print_raw_conversation()
print("ESBMC-AI Notice: error: ESBMC has timed out...")
sys.exit(1)

# Failure case
print(f"ESBMC-AI Notice: Failure {idx+1}/{max_retries}: Retrying...")
print(
f"ESBMC-AI Notice: Failure {idx+1}/{max_retries}" + ": Retrying..."
if idx != max_retries - 1
else ""
)

if config.raw_conversation:
print_raw_conversation()
Expand Down
Loading