mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 16:48:30 +00:00
Better agent execution error handling (#54)
A few quality of life improvements around cache handling and repeated tool usage
This commit is contained in:
@@ -4,7 +4,7 @@ import pytest
|
||||
from langchain.chat_models import ChatOpenAI as OpenAI
|
||||
|
||||
from crewai.agent import Agent
|
||||
from crewai.agents import CacheHandler
|
||||
from crewai.agents.cache import CacheHandler
|
||||
|
||||
|
||||
def test_agent_creation():
|
||||
|
||||
@@ -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|information`."
|
||||
== "\nError executing tool. Missing exact 3 pipe (|) separated values. For example, `coworker|task|information`.\n"
|
||||
)
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ def test_delegate_work_to_wrong_agent():
|
||||
|
||||
assert (
|
||||
result
|
||||
== "\nError executing tool. Co-worker mentioned on the Action Input not found, it must to be one of the following options: researcher."
|
||||
== "\nError executing tool. Co-worker mentioned on the Action Input not found, it must to be one of the following options: researcher.\n"
|
||||
)
|
||||
|
||||
|
||||
@@ -70,5 +70,5 @@ def test_ask_question_to_wrong_agent():
|
||||
|
||||
assert (
|
||||
result
|
||||
== "\nError executing tool. Co-worker mentioned on the Action Input not found, it must to be one of the following options: researcher."
|
||||
== "\nError executing tool. Co-worker mentioned on the Action Input not found, it must to be one of the following options: researcher.\n"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import json
|
||||
import pytest
|
||||
|
||||
from crewai.agent import Agent
|
||||
from crewai.agents import CacheHandler
|
||||
from crewai.agents.cache import CacheHandler
|
||||
from crewai.crew import Crew
|
||||
from crewai.process import Process
|
||||
from crewai.task import Task
|
||||
|
||||
Reference in New Issue
Block a user