Fix new errors

This commit is contained in:
Brandon Hancock
2025-02-14 15:29:20 -05:00
parent 8953af6133
commit 74e63621a5
2 changed files with 6 additions and 3 deletions

View File

@@ -371,7 +371,7 @@ class BaseAgent(ABC, BaseModel):
self.create_agent_executor()
def configure_executor(
self, cache_handler: CacheHandler, rpm_controller: RPMController
self, cache_handler: CacheHandler, rpm_controller: Optional[RPMController]
) -> None:
"""Configure the agent's executor with both cache and RPM handling.

View File

@@ -89,7 +89,7 @@ class Crew(BaseModel):
__hash__ = object.__hash__ # type: ignore
_execution_span: Any = PrivateAttr()
_rpm_controller: RPMController = PrivateAttr()
_rpm_controller: Optional[RPMController] = PrivateAttr()
_logger: Logger = PrivateAttr()
_file_handler: FileHandler = PrivateAttr()
_cache_handler: InstanceOf[CacheHandler] = PrivateAttr(default=CacheHandler())
@@ -274,7 +274,10 @@ class Crew(BaseModel):
# Now inject these external dependencies into each agent
for agent in self.agents:
agent.crew = self # ensure the agent's crew reference is set
agent.configure_executor(self._cache_handler, self._rpm_controller)
# If cache is disabled (_cache_handler is None) provide a new CacheHandler instance
agent.configure_executor(
self._cache_handler or CacheHandler(), self._rpm_controller
)
return self