Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,16 +45,6 @@ class GaiaAgent:
|
|
| 45 |
self.model = OpenAIServerModel(
|
| 46 |
model_id="gpt-4", # or "gpt-3.5-turbo" if you prefer
|
| 47 |
api_key=self.openai_key,
|
| 48 |
-
)
|
| 49 |
-
# 2) Define the tools
|
| 50 |
-
self.search_tool = DuckDuckGoSearchTool()
|
| 51 |
-
self.python_tool = PythonREPLTool(timeout=10) # Initialize PythonREPLTool
|
| 52 |
-
# 3) Create the CodeAgent
|
| 53 |
-
self.agent = CodeAgent(
|
| 54 |
-
model=self.model,
|
| 55 |
-
tools=[self.search_tool, self.python_tool],
|
| 56 |
-
# Encourage the agent to think step-by-step in code
|
| 57 |
-
max_steps=20,
|
| 58 |
system_prompt=(
|
| 59 |
"You are a meticulous AI agent. "
|
| 60 |
"Always think in Python code using the available tools. "
|
|
@@ -75,6 +65,16 @@ class GaiaAgent:
|
|
| 75 |
"# ```python\n"
|
| 76 |
"# print('hello'[::-1])\n"
|
| 77 |
"# ```\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
),
|
| 79 |
)
|
| 80 |
|
|
|
|
| 45 |
self.model = OpenAIServerModel(
|
| 46 |
model_id="gpt-4", # or "gpt-3.5-turbo" if you prefer
|
| 47 |
api_key=self.openai_key,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
system_prompt=(
|
| 49 |
"You are a meticulous AI agent. "
|
| 50 |
"Always think in Python code using the available tools. "
|
|
|
|
| 65 |
"# ```python\n"
|
| 66 |
"# print('hello'[::-1])\n"
|
| 67 |
"# ```\n"
|
| 68 |
+
)
|
| 69 |
+
# 2) Define the tools
|
| 70 |
+
self.search_tool = DuckDuckGoSearchTool()
|
| 71 |
+
self.python_tool = PythonREPLTool(timeout=10) # Initialize PythonREPLTool
|
| 72 |
+
# 3) Create the CodeAgent
|
| 73 |
+
self.agent = CodeAgent(
|
| 74 |
+
model=self.model,
|
| 75 |
+
tools=[self.search_tool, self.python_tool],
|
| 76 |
+
# Encourage the agent to think step-by-step in code
|
| 77 |
+
max_steps=20
|
| 78 |
),
|
| 79 |
)
|
| 80 |
|