bstraehle commited on
Commit
35828ac
·
verified ·
1 Parent(s): 8dde8b1

Update crew.py

Browse files
Files changed (1) hide show
  1. crew.py +25 -9
crew.py CHANGED
@@ -23,29 +23,45 @@ tracer_provider = register(
23
  CrewAIInstrumentor().instrument(tracer_provider=tracer_provider)
24
 
25
  def run_crew(question):
26
- search_tool = SerperDevTool()
27
  web_rag_tool = WebsiteSearchTool()
 
28
 
29
- research_agent = Agent(
30
- role="Web Research Agent",
31
  goal="Search the web for question \"{topic}\" and scrape the most relevant web page.",
32
- backstory="As an expert research assistant, you search the web for the question and scrape the most relevant web page.",
33
  allow_delegation=False,
34
- tools=[search_tool, web_rag_tool],
35
  verbose=True
36
  )
37
 
38
- research = Task(
39
- agent=research_agent,
 
 
 
 
 
 
 
 
 
40
  description="Search the web for question \"{topic}\" and scrape the most relevant web page.",
41
  expected_output="Content to help answer the question."
42
  )
43
 
 
 
 
 
 
 
44
  crew = Crew(
45
- agents=[research_agent],
46
  planning=True,
47
  process=Process.sequential,
48
- tasks=[research],
49
  verbose=True
50
  )
51
 
 
23
  CrewAIInstrumentor().instrument(tracer_provider=tracer_provider)
24
 
25
  def run_crew(question):
26
+ web_search_tool = SerperDevTool()
27
  web_rag_tool = WebsiteSearchTool()
28
+ youtube_search_tool = YoutubeVideoSearchTool()
29
 
30
+ web_search_agent = Agent(
31
+ role="Web Search Agent",
32
  goal="Search the web for question \"{topic}\" and scrape the most relevant web page.",
33
+ backstory="As an expert web search assistant, you search the web for the question and scrape the most relevant web page.",
34
  allow_delegation=False,
35
+ tools=[web_search_tool, web_rag_tool],
36
  verbose=True
37
  )
38
 
39
+ youtube_search_agent = Agent(
40
+ role="YouTube Search Agent",
41
+ goal="Search a YouTube video for question \"{topic}\".",
42
+ backstory="As an expert YouTube search assistant, you search a YouTube video.",
43
+ allow_delegation=False,
44
+ tools=[web_search_tool, web_rag_tool],
45
+ verbose=True
46
+ )
47
+
48
+ web_search = Task(
49
+ agent=web_search_agent,
50
  description="Search the web for question \"{topic}\" and scrape the most relevant web page.",
51
  expected_output="Content to help answer the question."
52
  )
53
 
54
+ youtube_search = Task(
55
+ agent=youtube_search_agent,
56
+ description="Search a YouTube video for question \"{topic}\"",
57
+ expected_output="Content to help answer the question."
58
+ )
59
+
60
  crew = Crew(
61
+ agents=[web_search_agent, youtube_search_agent],
62
  planning=True,
63
  process=Process.sequential,
64
+ tasks=[web_search, youtube_search],
65
  verbose=True
66
  )
67