Adding support for translations (#120)

Add translations support
This commit is contained in:
João Moura
2024-01-12 14:49:36 -03:00
committed by GitHub
parent ea7759b322
commit 8e7772c9c3
12 changed files with 148 additions and 101 deletions

View File

@@ -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()