Update crew.py
Browse files
crew.py
CHANGED
@@ -13,7 +13,8 @@ from openinference.instrumentation.crewai import CrewAIInstrumentor
|
|
13 |
from phoenix.otel import register
|
14 |
from util import get_final_answer
|
15 |
|
16 |
-
|
|
|
17 |
|
18 |
PHOENIX_API_KEY = os.environ["PHOENIX_API_KEY"]
|
19 |
|
@@ -43,9 +44,10 @@ def run_crew(question, file_name):
|
|
43 |
goal="Search an image for question \"{topic}\". ",
|
44 |
backstory="As an expert image search assistant, you search an image for the question. ",
|
45 |
allow_delegation=False,
|
46 |
-
|
|
|
47 |
tools=[image_search_tool],
|
48 |
-
verbose=
|
49 |
)
|
50 |
|
51 |
python_coding_agent = Agent(
|
@@ -53,6 +55,7 @@ def run_crew(question, file_name):
|
|
53 |
goal="Write and execute Python code to solve question \"{topic}\". ",
|
54 |
backstory="As an expert Python coding assistant, you write and execute Python for the question. ",
|
55 |
allow_delegation=False,
|
|
|
56 |
max_iter=1,
|
57 |
tools=[python_coding_tool],
|
58 |
verbose=False,
|
@@ -63,6 +66,7 @@ def run_crew(question, file_name):
|
|
63 |
goal="Search the web for question \"{topic}\" and scrape the most relevant web page. ",
|
64 |
backstory="As an expert web search assistant, you search the web for the question and scrape the most relevant web page. ",
|
65 |
allow_delegation=False,
|
|
|
66 |
max_iter=1,
|
67 |
tools=[web_search_tool, web_rag_tool],
|
68 |
verbose=False
|
@@ -73,6 +77,7 @@ def run_crew(question, file_name):
|
|
73 |
goal="Search a YouTube video for question \"{topic}\". ",
|
74 |
backstory="As an expert YouTube search assistant, you search a YouTube video for the question. ",
|
75 |
allow_delegation=False,
|
|
|
76 |
max_iter=1,
|
77 |
tools=[youtube_search_tool],
|
78 |
verbose=False
|
@@ -109,7 +114,7 @@ def run_crew(question, file_name):
|
|
109 |
crew = Crew(
|
110 |
agents=[image_search_agent, python_coding_agent, web_search_agent, youtube_search_agent],
|
111 |
planning=True,
|
112 |
-
planning_llm=
|
113 |
process=Process.sequential,
|
114 |
tasks=[image_search_task, python_coding_task, web_search_task, youtube_search_task],
|
115 |
verbose=False
|
|
|
13 |
from phoenix.otel import register
|
14 |
from util import get_final_answer
|
15 |
|
16 |
+
CREW_MODEL = "gpt-4.5-preview"
|
17 |
+
AGENT_MODEL = "gpt-4.5-preview"
|
18 |
|
19 |
PHOENIX_API_KEY = os.environ["PHOENIX_API_KEY"]
|
20 |
|
|
|
44 |
goal="Search an image for question \"{topic}\". ",
|
45 |
backstory="As an expert image search assistant, you search an image for the question. ",
|
46 |
allow_delegation=False,
|
47 |
+
llm=AGENT_MODEL,
|
48 |
+
max_iter=1,
|
49 |
tools=[image_search_tool],
|
50 |
+
verbose=False
|
51 |
)
|
52 |
|
53 |
python_coding_agent = Agent(
|
|
|
55 |
goal="Write and execute Python code to solve question \"{topic}\". ",
|
56 |
backstory="As an expert Python coding assistant, you write and execute Python for the question. ",
|
57 |
allow_delegation=False,
|
58 |
+
llm=AGENT_MODEL,
|
59 |
max_iter=1,
|
60 |
tools=[python_coding_tool],
|
61 |
verbose=False,
|
|
|
66 |
goal="Search the web for question \"{topic}\" and scrape the most relevant web page. ",
|
67 |
backstory="As an expert web search assistant, you search the web for the question and scrape the most relevant web page. ",
|
68 |
allow_delegation=False,
|
69 |
+
llm=AGENT_MODEL,
|
70 |
max_iter=1,
|
71 |
tools=[web_search_tool, web_rag_tool],
|
72 |
verbose=False
|
|
|
77 |
goal="Search a YouTube video for question \"{topic}\". ",
|
78 |
backstory="As an expert YouTube search assistant, you search a YouTube video for the question. ",
|
79 |
allow_delegation=False,
|
80 |
+
llm=AGENT_MODEL,
|
81 |
max_iter=1,
|
82 |
tools=[youtube_search_tool],
|
83 |
verbose=False
|
|
|
114 |
crew = Crew(
|
115 |
agents=[image_search_agent, python_coding_agent, web_search_agent, youtube_search_agent],
|
116 |
planning=True,
|
117 |
+
planning_llm=CREW_MODEL,
|
118 |
process=Process.sequential,
|
119 |
tasks=[image_search_task, python_coding_task, web_search_task, youtube_search_task],
|
120 |
verbose=False
|