keynes42 commited on
Commit
d9c3ea8
·
verified ·
1 Parent(s): 84f4310

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -138,12 +138,18 @@ class BasicAgent:
138
  python_tool = PreloadedPythonTool()
139
  html_parse_tool = VisitWebpageTool()
140
  # System prompt
 
 
 
141
  my_templates = PromptTemplates(
142
  system_prompt=(
143
  "When writing Python code in the PythonInterpreterTool,"
144
  "you must always import bs4 and regex (already preloaded),"
145
  "and *return* your result by calling final_answer(...). Do not assign to a variable named final_answer."
146
- )
 
 
 
147
  )
148
  # Initialize the agent
149
  self.agent = CodeAgent(model=self,
 
138
  python_tool = PreloadedPythonTool()
139
  html_parse_tool = VisitWebpageTool()
140
  # System prompt
141
+ # 1) Get the default templates
142
+ default_templates = PromptTemplates()
143
+ # 2) Construct a new one, swapping in only your system prompt
144
  my_templates = PromptTemplates(
145
  system_prompt=(
146
  "When writing Python code in the PythonInterpreterTool,"
147
  "you must always import bs4 and regex (already preloaded),"
148
  "and *return* your result by calling final_answer(...). Do not assign to a variable named final_answer."
149
+ ),
150
+ planning=default_templates.planning,
151
+ managed_agent=default_templates.managed_agent,
152
+ final_answer=default_templates.final_answer,
153
  )
154
  # Initialize the agent
155
  self.agent = CodeAgent(model=self,