Spaces:
Runtime error
Runtime error
Scott Cogan
commited on
Commit
·
20cd8aa
1
Parent(s):
e9c2ba5
fix: Update CustomCodeAgent to pass tools as list for template rendering
Browse files
app.py
CHANGED
|
@@ -243,9 +243,11 @@ 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 Jinja2 template rendering
|
| 247 |
return Template(template, undefined=StrictUndefined).render(
|
| 248 |
-
tools=
|
| 249 |
task=getattr(self, 'task', ''),
|
| 250 |
managed_agents=getattr(self, 'managed_agents', []),
|
| 251 |
authorized_imports=getattr(self, 'authorized_imports', [])
|
|
|
|
| 243 |
def initialize_system_prompt(self):
|
| 244 |
# Override to use tools_dict for template rendering
|
| 245 |
template = self.prompt_templates["system_prompt"]
|
| 246 |
+
# Convert tools_dict to list for template rendering
|
| 247 |
+
tools_list = list(self.tools_dict.values())
|
| 248 |
# Use Jinja2 template rendering
|
| 249 |
return Template(template, undefined=StrictUndefined).render(
|
| 250 |
+
tools=tools_list, # Pass tools as a list
|
| 251 |
task=getattr(self, 'task', ''),
|
| 252 |
managed_agents=getattr(self, 'managed_agents', []),
|
| 253 |
authorized_imports=getattr(self, 'authorized_imports', [])
|