Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -394,15 +394,12 @@ class SlpMultiAgent:
|
|
| 394 |
|
| 395 |
manager_agent = CodeAgent(
|
| 396 |
model=model if not isinstance(model, GeminiModel) else OpenAIServerModel(model_id="gpt-3.5-turbo", temperature=0.0, max_tokens=400),
|
| 397 |
-
tools=[GoogleSearchTool(), MathTool()
|
| 398 |
-
managed_agents=[research_agent, solver_agent],
|
| 399 |
name="ManagerAgent",
|
| 400 |
-
description="
|
| 401 |
-
additional_authorized_imports=["re", "math", "json", "pandas", "numpy", "requests", "time", "os", "tempfile", "uuid"],
|
| 402 |
-
planning_interval=1,
|
| 403 |
verbosity_level=0,
|
| 404 |
-
max_steps=
|
| 405 |
-
final_answer_checks=[]
|
| 406 |
)
|
| 407 |
|
| 408 |
# Create a task for the agent run with retry mechanism for rate limits
|
|
@@ -417,16 +414,17 @@ class SlpMultiAgent:
|
|
| 417 |
lambda: manager_agent.run(f"""
|
| 418 |
Question: {short_question}
|
| 419 |
|
| 420 |
-
|
| 421 |
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
|
|
|
|
|
|
| 426 |
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
Be precise and factual in your response.
|
| 430 |
""")
|
| 431 |
)
|
| 432 |
break # Success, exit retry loop
|
|
|
|
| 394 |
|
| 395 |
manager_agent = CodeAgent(
|
| 396 |
model=model if not isinstance(model, GeminiModel) else OpenAIServerModel(model_id="gpt-3.5-turbo", temperature=0.0, max_tokens=400),
|
| 397 |
+
tools=[GoogleSearchTool(), MathTool()],
|
|
|
|
| 398 |
name="ManagerAgent",
|
| 399 |
+
description="Answer questions using Google search and math tools.",
|
| 400 |
+
additional_authorized_imports=["re", "math", "json", "pandas", "numpy", "requests", "time", "os", "tempfile", "uuid"],
|
|
|
|
| 401 |
verbosity_level=0,
|
| 402 |
+
max_steps=3
|
|
|
|
| 403 |
)
|
| 404 |
|
| 405 |
# Create a task for the agent run with retry mechanism for rate limits
|
|
|
|
| 414 |
lambda: manager_agent.run(f"""
|
| 415 |
Question: {short_question}
|
| 416 |
|
| 417 |
+
Use the available tools to answer this question. Follow this format:
|
| 418 |
|
| 419 |
+
Thoughts: [Your reasoning]
|
| 420 |
+
<code>
|
| 421 |
+
# Use tools like:
|
| 422 |
+
result = google_search("your search query")
|
| 423 |
+
# or
|
| 424 |
+
result = math_calculator("your calculation")
|
| 425 |
|
| 426 |
+
final_answer("your answer")
|
| 427 |
+
</code>
|
|
|
|
| 428 |
""")
|
| 429 |
)
|
| 430 |
break # Success, exit retry loop
|