Spaces:
Sleeping
Sleeping
Vaishak G Kumar
commited on
Update main.py
Browse files
main.py
CHANGED
@@ -7,7 +7,6 @@ from src.mapper.e5map import E5Mapper
|
|
7 |
from src.mapper.scimap import scimap
|
8 |
from src.mapper.parser import MapperParser
|
9 |
from src.datatonic.dataloader import DataLoader
|
10 |
-
from src.teams.agentteam import codingteam, covid19team, financeteam, debateteam, homeworkteam, consultingteam
|
11 |
from src.agentics.agents import AgentsFactory
|
12 |
|
13 |
title = """# Welcome to 👩🏻🔬🧪SciTonic
|
@@ -101,6 +100,81 @@ def process_query(oai_key, query, max_auto_reply):
|
|
101 |
# Retrieve the Boss Assistant agent
|
102 |
boss_aid = agents_factory.scitonic()
|
103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
# Select and initiate team based on team mapping
|
105 |
team_function = {
|
106 |
"CodingTeam": codingteam,
|
@@ -113,7 +187,7 @@ def process_query(oai_key, query, max_auto_reply):
|
|
113 |
|
114 |
team_action = team_function.get(team, lambda: "No appropriate team found for the given input.")
|
115 |
return team_action()
|
116 |
-
|
117 |
|
118 |
|
119 |
def main():
|
|
|
7 |
from src.mapper.scimap import scimap
|
8 |
from src.mapper.parser import MapperParser
|
9 |
from src.datatonic.dataloader import DataLoader
|
|
|
10 |
from src.agentics.agents import AgentsFactory
|
11 |
|
12 |
title = """# Welcome to 👩🏻🔬🧪SciTonic
|
|
|
100 |
# Retrieve the Boss Assistant agent
|
101 |
boss_aid = agents_factory.scitonic()
|
102 |
|
103 |
+
def _reset_agents():
|
104 |
+
boss_aid.reset()
|
105 |
+
|
106 |
+
# Define functions for each team
|
107 |
+
def codingteam():
|
108 |
+
_reset_agents()
|
109 |
+
team = autogen.GroupChat(
|
110 |
+
agents=[scitonic, coder, pm, reviewer],
|
111 |
+
messages=[],
|
112 |
+
max_round=12,
|
113 |
+
speaker_selection_method="round_robin"
|
114 |
+
)
|
115 |
+
|
116 |
+
manager = autogen.GroupChatManager(groupchat=team, llm_config=llm_config)
|
117 |
+
boss_aid.initiate_chat(manager, problem=PROBLEM, n_results=3)
|
118 |
+
|
119 |
+
def covid19team():
|
120 |
+
_reset_agents()
|
121 |
+
team = autogen.GroupChat(
|
122 |
+
agents=[scitonic, covid19_scientist, healthcare_expert, finance_analyst],
|
123 |
+
messages=[],
|
124 |
+
max_round=12
|
125 |
+
)
|
126 |
+
|
127 |
+
manager = autogen.GroupChatManager(groupchat=team, llm_config=llm_config)
|
128 |
+
boss_aid.initiate_chat(manager, covid19_problem=COVID19_PROBLEM, n_results=3)
|
129 |
+
|
130 |
+
def financeteam():
|
131 |
+
_reset_agents()
|
132 |
+
team = autogen.GroupChat(
|
133 |
+
agents=[scitonic, finance_analyst, pm, reviewer, finance_expert],
|
134 |
+
messages=[],
|
135 |
+
max_round=12,
|
136 |
+
speaker_selection_method="round_robin"
|
137 |
+
)
|
138 |
+
|
139 |
+
manager = autogen.GroupChatManager(groupchat=team, llm_config=llm_config)
|
140 |
+
boss_aid.initiate_chat(manager, finance_problem=FINANCE_PROBLEM, n_results=3)
|
141 |
+
|
142 |
+
def debateteam():
|
143 |
+
_reset_agents()
|
144 |
+
team = autogen.GroupChat(
|
145 |
+
agents=[scitonic, debate_expert, pm, reviewer, debate_champion],
|
146 |
+
messages=[],
|
147 |
+
max_round=12,
|
148 |
+
speaker_selection_method="round_robin"
|
149 |
+
)
|
150 |
+
|
151 |
+
manager = autogen.GroupChatManager(groupchat=team, llm_config=llm_config)
|
152 |
+
boss_aid.initiate_chat(manager, debate_problem=DEBATE_PROBLEM, n_results=3)
|
153 |
+
|
154 |
+
def homeworkteam():
|
155 |
+
_reset_agents()
|
156 |
+
team = autogen.GroupChat(
|
157 |
+
agents=[scitonic, academic_expert, pm, reviewer, academic_whiz],
|
158 |
+
messages=[],
|
159 |
+
max_round=12,
|
160 |
+
speaker_selection_method="round_robin"
|
161 |
+
)
|
162 |
+
|
163 |
+
manager = autogen.GroupChatManager(groupchat=team, llm_config=llm_config)
|
164 |
+
boss_aid.initiate_chat(manager, homework_problem=HOMEWORK_PROBLEM, n_results=3)
|
165 |
+
|
166 |
+
def consultingteam():
|
167 |
+
_reset_agents()
|
168 |
+
team = autogen.GroupChat(
|
169 |
+
agents=[scitonic, consultant, pm, reviewer, consulting_pro],
|
170 |
+
messages=[],
|
171 |
+
max_round=12,
|
172 |
+
speaker_selection_method="round_robin"
|
173 |
+
)
|
174 |
+
|
175 |
+
manager = autogen.GroupChatManager(groupchat=team, llm_config=llm_config)
|
176 |
+
boss_aid.initiate_chat(manager, consulting_problem=CONSULTING_PROBLEM, n_results=3)
|
177 |
+
|
178 |
# Select and initiate team based on team mapping
|
179 |
team_function = {
|
180 |
"CodingTeam": codingteam,
|
|
|
187 |
|
188 |
team_action = team_function.get(team, lambda: "No appropriate team found for the given input.")
|
189 |
return team_action()
|
190 |
+
|
191 |
|
192 |
|
193 |
def main():
|