Spaces:
Runtime error
Runtime error
Scott Cogan
commited on
Commit
·
e9c2ba5
1
Parent(s):
16cd708
fix: Update CustomCodeAgent to use Jinja2 template rendering
Browse files
app.py
CHANGED
|
@@ -243,8 +243,8 @@ class CustomCodeAgent(CodeAgent):
|
|
| 243 |
def initialize_system_prompt(self):
|
| 244 |
# Override to use tools_dict for template rendering
|
| 245 |
template = self.prompt_templates["system_prompt"]
|
| 246 |
-
# Use
|
| 247 |
-
return template.
|
| 248 |
tools=self.tools_dict,
|
| 249 |
task=getattr(self, 'task', ''),
|
| 250 |
managed_agents=getattr(self, 'managed_agents', []),
|
|
|
|
| 243 |
def initialize_system_prompt(self):
|
| 244 |
# Override to use tools_dict for template rendering
|
| 245 |
template = self.prompt_templates["system_prompt"]
|
| 246 |
+
# Use Jinja2 template rendering
|
| 247 |
+
return Template(template, undefined=StrictUndefined).render(
|
| 248 |
tools=self.tools_dict,
|
| 249 |
task=getattr(self, 'task', ''),
|
| 250 |
managed_agents=getattr(self, 'managed_agents', []),
|