bstraehle commited on
Commit
0b498b7
·
verified ·
1 Parent(s): be96b46

Update crew.py

Browse files
Files changed (1) hide show
  1. crew.py +6 -2
crew.py CHANGED
@@ -21,7 +21,7 @@ tracer_provider = register(
21
 
22
  CrewAIInstrumentor().instrument(tracer_provider=tracer_provider)
23
 
24
- def get_crew():
25
  search_tool = SerperDevTool()
26
  web_rag_tool = WebsiteSearchTool()
27
 
@@ -69,7 +69,7 @@ def get_crew():
69
  # expected_output="The final answer to question \"{topic}\"."
70
  #)
71
 
72
- return Crew(
73
  agents=[research_agent, answer_agent],
74
  #manager_agent=manager_agent,
75
  planning=True,
@@ -79,6 +79,10 @@ def get_crew():
79
  verbose=True
80
  )
81
 
 
 
 
 
82
  @tool("Final answer tool.")
83
  def final_answer_tool(question: str, initial_answer: str) -> str:
84
  """Given a question and an initial answer, provide the final answer."""
 
21
 
22
  CrewAIInstrumentor().instrument(tracer_provider=tracer_provider)
23
 
24
+ def run_crew(question):
25
  search_tool = SerperDevTool()
26
  web_rag_tool = WebsiteSearchTool()
27
 
 
69
  # expected_output="The final answer to question \"{topic}\"."
70
  #)
71
 
72
+ crew = Crew(
73
  agents=[research_agent, answer_agent],
74
  #manager_agent=manager_agent,
75
  planning=True,
 
79
  verbose=True
80
  )
81
 
82
+ answer = crew().kickoff(inputs={"topic": question})
83
+
84
+ return final_answer(question, answer)
85
+
86
  @tool("Final answer tool.")
87
  def final_answer_tool(question: str, initial_answer: str) -> str:
88
  """Given a question and an initial answer, provide the final answer."""