Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,7 +51,14 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 51 |
prompt_templates = yaml.safe_load(stream)
|
| 52 |
|
| 53 |
if "final_answer" not in prompt_templates:
|
| 54 |
-
prompt_templates["final_answer"] =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
required_templates = ["planning", "managed_agent"]
|
| 57 |
|
|
@@ -69,6 +76,8 @@ for template in required_templates:
|
|
| 69 |
You are a managed agent who will execute a task with steps defined for you. After each step,
|
| 70 |
you should provide 'Thought:', 'Code:', and 'Observation:' sequences to guide the process.
|
| 71 |
"""
|
|
|
|
|
|
|
| 72 |
|
| 73 |
agent = CodeAgent(
|
| 74 |
model=model,
|
|
|
|
| 51 |
prompt_templates = yaml.safe_load(stream)
|
| 52 |
|
| 53 |
if "final_answer" not in prompt_templates:
|
| 54 |
+
prompt_templates["final_answer"] = {
|
| 55 |
+
"template": "This is the final answer: {answer}",
|
| 56 |
+
"pre_messages": "You are about to receive the final answer."
|
| 57 |
+
}
|
| 58 |
+
else:
|
| 59 |
+
# Ensure 'pre_messages' exists within 'final_answer' template
|
| 60 |
+
if "pre_messages" not in prompt_templates["final_answer"]:
|
| 61 |
+
prompt_templates["final_answer"]["pre_messages"] = "You are about to receive the final answer."
|
| 62 |
|
| 63 |
required_templates = ["planning", "managed_agent"]
|
| 64 |
|
|
|
|
| 76 |
You are a managed agent who will execute a task with steps defined for you. After each step,
|
| 77 |
you should provide 'Thought:', 'Code:', and 'Observation:' sequences to guide the process.
|
| 78 |
"""
|
| 79 |
+
|
| 80 |
+
|
| 81 |
|
| 82 |
agent = CodeAgent(
|
| 83 |
model=model,
|