Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,17 +39,18 @@ class BasicAgent:
|
|
| 39 |
|
| 40 |
|
| 41 |
agent = CodeAgent(
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
#additional_authorized_imports=["json", "from PIL import Image, ImageDraw, ImageFont", "import matplotlib.pyplot as plt", "from typing import List, Dict"],
|
| 48 |
-
#managed_agents=[detection_agent]
|
| 49 |
-
#description="Solves the task"
|
| 50 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
fixed_answer = agent
|
| 53 |
|
| 54 |
# url = "https://api.fireworks.ai/inference/v1/chat/completions"
|
| 55 |
# payload = {
|
|
@@ -91,7 +92,7 @@ class BasicAgent:
|
|
| 91 |
|
| 92 |
|
| 93 |
# print(f"Agent returning fixed answer: {fixed_answer}")
|
| 94 |
-
return fixed_answer
|
| 95 |
|
| 96 |
|
| 97 |
|
|
|
|
| 39 |
|
| 40 |
|
| 41 |
agent = CodeAgent(
|
| 42 |
+
tools=[final_answer, search],
|
| 43 |
+
model=model,
|
| 44 |
+
max_steps=5,
|
| 45 |
+
verbosity_level=1,
|
| 46 |
+
planning_interval=2
|
|
|
|
|
|
|
|
|
|
| 47 |
)
|
| 48 |
+
|
| 49 |
+
# Get the actual answer from the agent
|
| 50 |
+
answer = agent.run(question) # Assuming run() returns the answer
|
| 51 |
+
return str(answer) # Ensure it's a string
|
| 52 |
|
| 53 |
+
#fixed_answer = agent
|
| 54 |
|
| 55 |
# url = "https://api.fireworks.ai/inference/v1/chat/completions"
|
| 56 |
# payload = {
|
|
|
|
| 92 |
|
| 93 |
|
| 94 |
# print(f"Agent returning fixed answer: {fixed_answer}")
|
| 95 |
+
#return fixed_answer
|
| 96 |
|
| 97 |
|
| 98 |
|