Spaces:
Running
Running
Update agent.py
Browse files
agent.py
CHANGED
@@ -388,14 +388,14 @@ class MagAgent:
|
|
388 |
}
|
389 |
|
390 |
def _build_task_prompt(self, question: str, task_id: str) -> str:
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
|
400 |
async def _execute_agent(self, question: str, task_id: str) -> str:
|
401 |
return await asyncio.to_thread(
|
|
|
388 |
}
|
389 |
|
390 |
def _build_task_prompt(self, question: str, task_id: str) -> str:
|
391 |
+
"""Constructs task-specific prompts using templates"""
|
392 |
+
base_template = self.prompt_templates.get("base_prompt", "")
|
393 |
+
task_template = self.prompt_templates.get("task_prompt", "").format(
|
394 |
+
question=question,
|
395 |
+
task_id=task_id,
|
396 |
+
current_date=datetime.now().strftime("%Y-%m-%d")
|
397 |
+
)
|
398 |
+
return f"{base_template}\n\n{task_template}"
|
399 |
|
400 |
async def _execute_agent(self, question: str, task_id: str) -> str:
|
401 |
return await asyncio.to_thread(
|