Skip to content

Commit

Permalink
FCM Latest State: Fixed bug that did not actually store message history
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiannis128 committed Apr 19, 2024
1 parent 7d30d47 commit 932f60e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion esbmc_ai/latest_state_solution_generator.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Author: Yiannis Charalambous

from typing_extensions import override
from langchain import BaseMessage
from langchain_core.messages import BaseMessage
from esbmc_ai.solution_generator import SolutionGenerator
from esbmc_ai.chat_response import FinishReason

# TODO Test me


class LatestStateSolutionGenerator(SolutionGenerator):
"""SolutionGenerator that only shows the latest source code and verifier
Expand All @@ -18,6 +20,8 @@ def generate_solution(self) -> tuple[str, FinishReason]:
messages: list[BaseMessage] = self.messages
self.messages: list[BaseMessage] = []
solution, finish_reason = super().generate_solution()
# Append last messages to the messages stack
messages.extend(self.messages)
# Restore
self.messages = messages
return solution, finish_reason

0 comments on commit 932f60e

Please sign in to comment.