From 47098ad74f485230d3c14a2abad4d19508d0bf9b Mon Sep 17 00:00:00 2001 From: Yiannis Charalambous Date: Fri, 19 Apr 2024 00:21:11 +0100 Subject: [PATCH 1/3] Fix Code Mode: Formatted notice messages --- esbmc_ai/commands/fix_code_command.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/esbmc_ai/commands/fix_code_command.py b/esbmc_ai/commands/fix_code_command.py index c624ea3..51078ed 100644 --- a/esbmc_ai/commands/fix_code_command.py +++ b/esbmc_ai/commands/fix_code_command.py @@ -101,7 +101,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) @@ -120,6 +120,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) @@ -131,7 +132,7 @@ def print_raw_conversation() -> None: if config.raw_conversation: print_raw_conversation() - printv("ESBMC-AI Notice: Successfully verified code") + printv("ESBMC-AI Notice: Successfuly verified code") return False, source_code @@ -146,11 +147,17 @@ def print_raw_conversation() -> None: except SourceCodeParseError: pass 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 "" + ) # Update state solution_generator.update_state(source_code, esbmc_output) From a347e202f2013bfe3f8645ed59e361d5637af762 Mon Sep 17 00:00:00 2001 From: Yiannis Charalambous Date: Fri, 19 Apr 2024 11:40:49 +0100 Subject: [PATCH 2/3] Update comments --- esbmc_ai/commands/fix_code_command.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/esbmc_ai/commands/fix_code_command.py b/esbmc_ai/commands/fix_code_command.py index 51078ed..e2f068d 100644 --- a/esbmc_ai/commands/fix_code_command.py +++ b/esbmc_ai/commands/fix_code_command.py @@ -3,7 +3,6 @@ import sys from typing import Any, Tuple from typing_extensions import override -from langchain.schema import AIMessage, HumanMessage from esbmc_ai.chat_response import FinishReason @@ -23,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() From a6d9edec0df6cac18a2882f551225a819f8313d6 Mon Sep 17 00:00:00 2001 From: Yiannis Charalambous Date: Fri, 19 Apr 2024 11:49:11 +0100 Subject: [PATCH 3/3] FCM: Reverted Successfuly to Successfully as per the Oxford Dictionary --- esbmc_ai/commands/fix_code_command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esbmc_ai/commands/fix_code_command.py b/esbmc_ai/commands/fix_code_command.py index e2f068d..6a8edb8 100644 --- a/esbmc_ai/commands/fix_code_command.py +++ b/esbmc_ai/commands/fix_code_command.py @@ -129,7 +129,7 @@ def print_raw_conversation() -> None: if config.raw_conversation: print_raw_conversation() - printv("ESBMC-AI Notice: Successfuly verified code") + printv("ESBMC-AI Notice: Successfully verified code") return False, source_code