mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
Fix new errors
This commit is contained in:
@@ -371,7 +371,7 @@ class BaseAgent(ABC, BaseModel):
|
|||||||
self.create_agent_executor()
|
self.create_agent_executor()
|
||||||
|
|
||||||
def configure_executor(
|
def configure_executor(
|
||||||
self, cache_handler: CacheHandler, rpm_controller: RPMController
|
self, cache_handler: CacheHandler, rpm_controller: Optional[RPMController]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Configure the agent's executor with both cache and RPM handling.
|
"""Configure the agent's executor with both cache and RPM handling.
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ class Crew(BaseModel):
|
|||||||
|
|
||||||
__hash__ = object.__hash__ # type: ignore
|
__hash__ = object.__hash__ # type: ignore
|
||||||
_execution_span: Any = PrivateAttr()
|
_execution_span: Any = PrivateAttr()
|
||||||
_rpm_controller: RPMController = PrivateAttr()
|
_rpm_controller: Optional[RPMController] = PrivateAttr()
|
||||||
_logger: Logger = PrivateAttr()
|
_logger: Logger = PrivateAttr()
|
||||||
_file_handler: FileHandler = PrivateAttr()
|
_file_handler: FileHandler = PrivateAttr()
|
||||||
_cache_handler: InstanceOf[CacheHandler] = PrivateAttr(default=CacheHandler())
|
_cache_handler: InstanceOf[CacheHandler] = PrivateAttr(default=CacheHandler())
|
||||||
@@ -274,7 +274,10 @@ class Crew(BaseModel):
|
|||||||
# Now inject these external dependencies into each agent
|
# Now inject these external dependencies into each agent
|
||||||
for agent in self.agents:
|
for agent in self.agents:
|
||||||
agent.crew = self # ensure the agent's crew reference is set
|
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
|
return self
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user