mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 14:04:27 +01:00
fix(agent): Omit EventHistory progress message if empty
Also add a heading to the progress section
This commit is contained in:
@@ -34,13 +34,12 @@ class EventHistoryComponent(MessageProvider, AfterParse, AfterExecute):
|
|||||||
self.llm_provider = llm_provider
|
self.llm_provider = llm_provider
|
||||||
|
|
||||||
def get_messages(self) -> Iterator[ChatMessage]:
|
def get_messages(self) -> Iterator[ChatMessage]:
|
||||||
yield ChatMessage.system(
|
if progress := self._compile_progress(
|
||||||
self._compile_progress(
|
|
||||||
self.event_history.episodes,
|
self.event_history.episodes,
|
||||||
self.max_tokens,
|
self.max_tokens,
|
||||||
self.count_tokens,
|
self.count_tokens,
|
||||||
)
|
):
|
||||||
)
|
yield ChatMessage.system(f"## Progress on your Task so far\n\n{progress}")
|
||||||
|
|
||||||
def after_parse(self, result: ThoughtProcessOutput) -> None:
|
def after_parse(self, result: ThoughtProcessOutput) -> None:
|
||||||
if result.command_name:
|
if result.command_name:
|
||||||
|
|||||||
Reference in New Issue
Block a user