Adding support to force a tool return to be the final answer. (#867)

* Adding support to force a tool return to be the final answer.
This will at the end of the execution return the tool output.
It will return the output of the latest tool with the flag

* Update src/crewai/agent.py

Co-authored-by: Gui Vieira <guilherme_vieira@me.com>

* Update tests/agent_test.py

Co-authored-by: Gui Vieira <guilherme_vieira@me.com>

---------

Co-authored-by: Gui Vieira <guilherme_vieira@me.com>
This commit is contained in:
João Moura
2024-07-04 12:36:00 -07:00
committed by GitHub
parent 45a4d15811
commit b51cf24f0f
16 changed files with 207777 additions and 6651 deletions

View File

@@ -310,7 +310,7 @@ def test_output_json_to_another_task():
crew = Crew(agents=[scorer], tasks=[task1, task2])
result = crew.kickoff()
assert '{\n "score": 3\n}' == result
assert '{\n "score": 5\n}' == result
@pytest.mark.vcr(filter_headers=["authorization"])