mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-22 22:58:13 +00:00
fix: make task required in CrewAgentExecutor and fix all type annotations
- Make task parameter required in CrewAgentExecutor.__init__ - Update Agent.create_agent_executor to require task parameter - Handle cases where crew can be None (standalone agent usage) - Update base class signatures to match - Remove unnecessary create_agent_executor calls during setup - Add missing type annotations in base_agent_executor_mixin - Fix all type errors in base_agent.py using Self return type - Add assert for agent_executor before use - Fix crew access checks to handle None case
This commit is contained in:
@@ -1116,7 +1116,9 @@ def test_not_using_system_prompt():
|
||||
use_system_prompt=False,
|
||||
)
|
||||
|
||||
agent.create_agent_executor()
|
||||
# Create a dummy task for testing
|
||||
task = Task(description="Test task", expected_output="Test output", agent=agent)
|
||||
agent.create_agent_executor(task)
|
||||
assert not agent.agent_executor.prompt.get("user")
|
||||
assert not agent.agent_executor.prompt.get("system")
|
||||
|
||||
@@ -1128,7 +1130,9 @@ def test_using_system_prompt():
|
||||
backstory="I am the master of {role}",
|
||||
)
|
||||
|
||||
agent.create_agent_executor()
|
||||
# Create a dummy task for testing
|
||||
task = Task(description="Test task", expected_output="Test output", agent=agent)
|
||||
agent.create_agent_executor(task)
|
||||
assert agent.agent_executor.prompt.get("user")
|
||||
assert agent.agent_executor.prompt.get("system")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user