mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
@@ -240,10 +240,15 @@ def test_agent_moved_on_after_max_iterations():
|
||||
allow_delegation=False,
|
||||
)
|
||||
|
||||
output = agent.execute_task(
|
||||
task="The final answer is 42. But don't give it yet, instead keep using the `get_final_answer` tool.",
|
||||
tools=[get_final_answer],
|
||||
)
|
||||
assert (
|
||||
output == "I have used the tool multiple times and the final answer remains 42."
|
||||
)
|
||||
with patch.object(
|
||||
CrewAgentExecutor, "_force_answer", wraps=agent.agent_executor._force_answer
|
||||
) as private_mock:
|
||||
output = agent.execute_task(
|
||||
task="The final answer is 42. But don't give it yet, instead keep using the `get_final_answer` tool.",
|
||||
tools=[get_final_answer],
|
||||
)
|
||||
assert (
|
||||
output
|
||||
== "I have used the tool multiple times and the final answer remains 42."
|
||||
)
|
||||
private_mock.assert_called_once()
|
||||
|
||||
@@ -48,7 +48,7 @@ def test_delegate_work_with_wrong_input():
|
||||
|
||||
assert (
|
||||
result
|
||||
== "\nError executing tool. Missing exact 3 pipe (|) separated values. For example, `coworker|task|context`. I need to make sure to pass context as context\n"
|
||||
== "\nError executing tool. Missing exact 3 pipe (|) separated values. For example, `coworker|task|context`. I need to make sure to pass context as context.\n"
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user