mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 16:48:30 +00:00
spider_tool working, not spider_full_tool
This commit is contained in:
38
tests/spider_full_tool_test.py
Normal file
38
tests/spider_full_tool_test.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import os
|
||||
from crewai_tools.tools.spider_full_tool.spider_full_tool import SpiderFullTool, SpiderFullParams
|
||||
from crewai import Agent, Task, Crew
|
||||
|
||||
def test_spider_tool():
|
||||
spider_tool = SpiderFullTool()
|
||||
|
||||
params = SpiderFullParams(
|
||||
return_format="markdown"
|
||||
)
|
||||
|
||||
docs = spider_tool._run("https://spider.cloud", params=params)
|
||||
print(docs)
|
||||
|
||||
# searcher = Agent(
|
||||
# role="Web Research Expert",
|
||||
# goal="Find related information from specific URL's",
|
||||
# backstory="An expert web researcher that uses the web extremely well",
|
||||
# tools=[spider_tool],
|
||||
# verbose=True
|
||||
# )
|
||||
|
||||
# summarize_spider = Task(
|
||||
# description="Summarize the content of spider.cloud",
|
||||
# expected_output="A summary that goes over what spider does",
|
||||
# agent=searcher
|
||||
# )
|
||||
|
||||
# crew = Crew(
|
||||
# agents=[searcher],
|
||||
# tasks=[summarize_spider],
|
||||
# verbose=2
|
||||
# )
|
||||
|
||||
# crew.kickoff()
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_spider_tool()
|
||||
31
tests/spider_tool_test.py
Normal file
31
tests/spider_tool_test.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import os
|
||||
from crewai_tools.tools.spider_tool.spider_tool import SpiderTool
|
||||
from crewai import Agent, Task, Crew
|
||||
|
||||
def test_spider_tool():
|
||||
spider_tool = SpiderTool()
|
||||
|
||||
searcher = Agent(
|
||||
role="Web Research Expert",
|
||||
goal="Find related information from specific URL's",
|
||||
backstory="An expert web researcher that uses the web extremely well",
|
||||
tools=[spider_tool],
|
||||
verbose=True
|
||||
)
|
||||
|
||||
summarize_spider = Task(
|
||||
description="Summarize the content of spider.cloud",
|
||||
expected_output="A summary that goes over what spider does",
|
||||
agent=searcher
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[searcher],
|
||||
tasks=[summarize_spider],
|
||||
verbose=2
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_spider_tool()
|
||||
Reference in New Issue
Block a user