Update agents/crew.py
Browse files- agents/crew.py +13 -2
agents/crew.py
CHANGED
|
@@ -173,6 +173,17 @@ class GAIACrew():
|
|
| 173 |
verbose=VERBOSE_AGENT
|
| 174 |
)
|
| 175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
@agent
|
| 177 |
def manager_agent(self) -> Agent:
|
| 178 |
return Agent(
|
|
@@ -208,11 +219,11 @@ def run_crew(question, file_path):
|
|
| 208 |
final_question = f"{question} File path: {file_path}."
|
| 209 |
|
| 210 |
answer = GAIACrew().crew().kickoff(inputs={"question": final_question})
|
| 211 |
-
final_answer = get_final_answer(question, str(answer))
|
| 212 |
|
| 213 |
print(f"🤖 Initial question: {question}")
|
| 214 |
print(f"🤖 Final question: {final_question}")
|
| 215 |
-
print(f"🤖 Initial answer: {answer}")
|
| 216 |
print(f"🤖 Final answer: {final_answer}")
|
| 217 |
|
| 218 |
return final_answer
|
|
|
|
| 173 |
verbose=VERBOSE_AGENT
|
| 174 |
)
|
| 175 |
|
| 176 |
+
@agent
|
| 177 |
+
def final_answer_agent(self) -> Agent:
|
| 178 |
+
return Agent(
|
| 179 |
+
config=self.agents_config["final_answer_agent"],
|
| 180 |
+
allow_delegation=False,
|
| 181 |
+
llm=LLM_AGENT,
|
| 182 |
+
max_iter=2,
|
| 183 |
+
tools=[AITools.final_answer_tool],
|
| 184 |
+
verbose=VERBOSE_AGENT
|
| 185 |
+
)
|
| 186 |
+
|
| 187 |
@agent
|
| 188 |
def manager_agent(self) -> Agent:
|
| 189 |
return Agent(
|
|
|
|
| 219 |
final_question = f"{question} File path: {file_path}."
|
| 220 |
|
| 221 |
answer = GAIACrew().crew().kickoff(inputs={"question": final_question})
|
| 222 |
+
#final_answer = get_final_answer(question, str(answer))
|
| 223 |
|
| 224 |
print(f"🤖 Initial question: {question}")
|
| 225 |
print(f"🤖 Final question: {final_question}")
|
| 226 |
+
#print(f"🤖 Initial answer: {answer}")
|
| 227 |
print(f"🤖 Final answer: {final_answer}")
|
| 228 |
|
| 229 |
return final_answer
|