Adding tool caching a loop execution prevention. (#25)

* Adding tool caching a loop execution prevention.

This adds some guardrails, to both prevent the same tool to be used
consecutively and also caching tool's results across the entire crew
so it cuts down execution time and eventual LLM calls.

This plays a huge role for smaller opensource models that usually fall
into those behaviors patterns.

It also includes some smaller improvements around the tool prompt and
agent tools, all with the same intention of guiding models into
better conform with agent instructions.
This commit is contained in:
João Moura
2023-12-29 22:35:23 -03:00
committed by GitHub
parent 5cc230263c
commit af9e749edb
14 changed files with 3046 additions and 54 deletions

View File

@@ -48,7 +48,7 @@ def test_delegate_work_with_wrong_input():
assert (
result
== "Error executing tool. Missing exact 3 pipe (|) separated values. For example, `coworker|task|information`."
== "\nError executing tool. Missing exact 3 pipe (|) separated values. For example, `coworker|task|information`."
)
@@ -59,7 +59,7 @@ def test_delegate_work_to_wrong_agent():
assert (
result
== "Error executing tool. Co-worker not found, double check the co-worker."
== "\nError executing tool. Co-worker mentioned on the Action Input not found, it must to be one of the following options: researcher."
)
@@ -70,5 +70,5 @@ def test_ask_question_to_wrong_agent():
assert (
result
== "Error executing tool. Co-worker not found, double check the co-worker."
== "\nError executing tool. Co-worker mentioned on the Action Input not found, it must to be one of the following options: researcher."
)