Skip to content

Commit

Permalink
replace DuckDuckGoSearchRun to MockTool
Browse files Browse the repository at this point in the history
  • Loading branch information
User committed Jul 5, 2024
1 parent 408dd8c commit 28b6561
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_agents/test_agents.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import os
import pytest

from langchain_community.tools import DuckDuckGoSearchRun
from langchain_core.prompts.chat import ChatPromptTemplate
from motleycrew.agents.crewai.crewai_agent import CrewAIMotleyAgent
from motleycrew.agents.langchain.tool_calling_react import ReActToolCallingAgent
from motleycrew.agents.llama_index.llama_index_react import ReActLlamaIndexMotleyAgent
from motleycrew.common.exceptions import AgentNotMaterialized, CannotModifyMaterializedAgent
from motleycrew.tools.python_repl import create_repl_tool
from motleycrew.tools.tool import MotleyTool
from tests.test_agents import MockTool

os.environ["OPENAI_API_KEY"] = "YOUR OPENAI API KEY"

Expand All @@ -28,7 +28,7 @@ def crewai_agent(self):
backstory="",
verbose=True,
delegation=False,
tools=[DuckDuckGoSearchRun()],
tools=[MockTool()],
)
return agent

Expand All @@ -38,7 +38,7 @@ def langchain_agent(self):
name="AI writer agent",
prompt_prefix="Generate AI-generated content",
description="AI-generated content",
tools=[DuckDuckGoSearchRun()],
tools=[MockTool()],
verbose=True,
)
return agent
Expand All @@ -48,7 +48,7 @@ def llama_index_agent(self):
agent = ReActLlamaIndexMotleyAgent(
prompt_prefix="Uncover cutting-edge developments in AI and data science",
description="AI researcher",
tools=[DuckDuckGoSearchRun()],
tools=[MockTool()],
verbose=True,
)
return agent
Expand All @@ -65,7 +65,7 @@ def agent(self, request, crewai_agent, langchain_agent, llama_index_agent):
@pytest.mark.parametrize("agent", test_agents_names, indirect=True)
def test_add_tools(self, agent):
assert len(agent.tools) == 1
tools = [DuckDuckGoSearchRun()]
tools = [MockTool()]
agent.add_tools(tools)
assert len(agent.tools) == 1

Expand Down

0 comments on commit 28b6561

Please sign in to comment.