bstraehle commited on
Commit
4afee64
Β·
verified Β·
1 Parent(s): 7bdf463

Update agents/crew.py

Browse files
Files changed (1) hide show
  1. agents/crew.py +11 -5
agents/crew.py CHANGED
@@ -3,7 +3,7 @@
3
  # https://docs.crewai.com/introduction
4
  # https://arize.com/docs/phoenix/integrations/python/crewai/crewai-tracing
5
 
6
- import os
7
  from agents.models.llms import (
8
  LLM_CREW_MANAGER,
9
  LLM_CREW_PLANNING,
@@ -54,6 +54,8 @@ tracer_provider = register(
54
  set_global_tracer_provider=True
55
  )
56
 
 
 
57
  @CrewBase
58
  class GAIACrew():
59
  agents: List[BaseAgent]
@@ -229,12 +231,13 @@ class GAIACrew():
229
  return Crew(
230
  agents=self.agents,
231
  tasks=self.tasks,
232
- process=Process.sequential, # TODO
233
- manager_llm=LLM_CREW_MANAGER, # TODO
234
  planning_llm=LLM_CREW_PLANNING,
235
  planning=PLANNING_CREW,
236
  memory=MEMORY_CREW,
237
- verbose=VERBOSE_CREW
 
238
  )
239
 
240
  def run_crew(question, file_path):
@@ -250,7 +253,10 @@ def run_crew(question, file_path):
250
  print(f"πŸ€– Initial question: {question}")
251
  print(f"πŸ€– Final question: {final_question}")
252
 
253
- answer = GAIACrew().crew().kickoff(inputs={"question": final_question})
 
 
 
254
  final_answer = AITools.get_final_answer(question, str(answer))
255
 
256
  print(f"πŸ€– Initial answer: {answer}")
 
3
  # https://docs.crewai.com/introduction
4
  # https://arize.com/docs/phoenix/integrations/python/crewai/crewai-tracing
5
 
6
+ import logging, os
7
  from agents.models.llms import (
8
  LLM_CREW_MANAGER,
9
  LLM_CREW_PLANNING,
 
54
  set_global_tracer_provider=True
55
  )
56
 
57
+ logging.getLogger("openinference").setLevel(logging.CRITICAL)
58
+
59
  @CrewBase
60
  class GAIACrew():
61
  agents: List[BaseAgent]
 
231
  return Crew(
232
  agents=self.agents,
233
  tasks=self.tasks,
234
+ process=Process.sequential,
235
+ manager_llm=LLM_CREW_MANAGER,
236
  planning_llm=LLM_CREW_PLANNING,
237
  planning=PLANNING_CREW,
238
  memory=MEMORY_CREW,
239
+ verbose=VERBOSE_CREW,
240
+ tracing=False # Arize Phoenix
241
  )
242
 
243
  def run_crew(question, file_path):
 
253
  print(f"πŸ€– Initial question: {question}")
254
  print(f"πŸ€– Final question: {final_question}")
255
 
256
+ print(f"πŸ€– Crew started")
257
+ answer = GAIACrew().crew().kickoff(inputs={"question": final_question})
258
+ print(f"πŸ€– Crew completed")
259
+
260
  final_answer = AITools.get_final_answer(question, str(answer))
261
 
262
  print(f"πŸ€– Initial answer: {answer}")