Ludo7127 commited on
Commit
fa3e07e
·
verified ·
1 Parent(s): 981e13a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -144,25 +144,25 @@ IMAGE_RULE = (
144
  "Always finish by calling final_answer(<plain text> with any IMAGE lines)."
145
  )
146
 
147
- DEFAULT_PROMPTS = {
148
- "system_prompt": (
149
- "You are a helpful coding agent. Use tools when helpful. "
150
- "Prefer concise answers. "
151
  + IMAGE_RULE
152
  ),
153
- "final_answer": (
154
- "Provide the final answer the user should see. "
155
- "Do not include internal thoughts."
 
156
  ),
157
- "planning": (
158
- "Briefly plan steps if needed before calling tools. "
159
- "Keep plans short."
160
  ),
161
- "managed_agent": (
162
- "You may be delegated a subtask. Follow the manager's instructions "
163
- "and return a clear, concise result."
164
  ),
165
- }
166
 
167
  # Start with defaults, let user overrides replace them
168
  prompt_templates = {**DEFAULT_PROMPTS, **(user_prompts or {})}
 
144
  "Always finish by calling final_answer(<plain text> with any IMAGE lines)."
145
  )
146
 
147
+ prompt_templates = PromptTemplates(
148
+ system_prompt=(
149
+ "You are a helpful coding agent. Use tools when helpful. Prefer concise answers. "
 
150
  + IMAGE_RULE
151
  ),
152
+ planning=PlanningPromptTemplate(
153
+ plan="Briefly plan steps before acting when needed.",
154
+ update_plan_pre_messages="Update the plan considering the latest observation.",
155
+ update_plan_post_messages="Summarize the updated plan."
156
  ),
157
+ managed_agent=ManagedAgentPromptTemplate(
158
+ task="You are delegated a subtask: {task}. Follow the manager's instructions.",
159
+ report="Return a clear, concise report of what you did and the result."
160
  ),
161
+ final_answer=FinalAnswerPromptTemplate(
162
+ pre_messages="Provide the final answer the user should see.",
163
+ post_messages="End of answer."
164
  ),
165
+ )
166
 
167
  # Start with defaults, let user overrides replace them
168
  prompt_templates = {**DEFAULT_PROMPTS, **(user_prompts or {})}