Refactoring task cache to be a tool (#50)

* Refactoring task cache to be a tool

The previous implementation of the task caching system was early exiting
the agent executor due to the fact it was returning an AgentFinish object.

This now refactors it to use a cache specific tool that is dynamically
added and forced into the agent in case of a task execution that was
already executed with the same input.
This commit is contained in:
João Moura
2024-01-04 21:29:42 -03:00
committed by GitHub
parent fe6bef0af1
commit 6b054651a7
12 changed files with 1851 additions and 576 deletions

View File

@@ -241,12 +241,12 @@ def test_cache_hitting_between_agents():
tasks = [
Task(
description="What is 2 tims 6?",
description="What is 2 tims 6? Return only the number.",
tools=[multiplier],
agent=ceo,
),
Task(
description="What is 2 times 6?",
description="What is 2 times 6? Return only the number.",
tools=[multiplier],
agent=researcher,
),