Fixed core invoke loop logic and relevant tests (#1865)

* Fixed core invoke loop logic and relevant tests

* Fix failing tests

* Clean up final print statements

* Additional clean up for PR review
This commit is contained in:
Brandon Hancock (bhancock_ai)
2025-01-09 12:13:02 -05:00
committed by GitHub
parent b3504e768c
commit 2131b94ddb
11 changed files with 1854 additions and 32101 deletions

View File

@@ -19,15 +19,10 @@ class CrewAgentExecutorMixin:
agent: Optional["BaseAgent"]
task: Optional["Task"]
iterations: int
have_forced_answer: bool
max_iter: int
_i18n: I18N
_printer: Printer = Printer()
def _should_force_answer(self) -> bool:
"""Determine if a forced answer is required based on iteration count."""
return (self.iterations >= self.max_iter) and not self.have_forced_answer
def _create_short_term_memory(self, output) -> None:
"""Create and save a short-term memory item if conditions are met."""
if (