Spaces:
Runtime error
Runtime error
Scott Cogan
commited on
Commit
·
49446cb
1
Parent(s):
954e4c6
fix: update template validation to use dictionary of tools
Browse files
app.py
CHANGED
|
@@ -88,9 +88,8 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 88 |
logger.debug("Starting template validation...")
|
| 89 |
try:
|
| 90 |
# Create test tools for validation
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
]
|
| 94 |
|
| 95 |
# Validate templates
|
| 96 |
for key, value in prompt_templates.items():
|
|
@@ -110,7 +109,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 110 |
# Create a template with the task variable
|
| 111 |
template = Template(template_str, undefined=StrictUndefined)
|
| 112 |
rendered = template.render(
|
| 113 |
-
tools=test_tools,
|
| 114 |
task="test",
|
| 115 |
name="test",
|
| 116 |
final_answer="test",
|
|
@@ -135,7 +134,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 135 |
# Create a template with the task variable
|
| 136 |
template = Template(template_str, undefined=StrictUndefined)
|
| 137 |
rendered = template.render(
|
| 138 |
-
tools=test_tools,
|
| 139 |
task="test",
|
| 140 |
name="test",
|
| 141 |
final_answer="test",
|
|
|
|
| 88 |
logger.debug("Starting template validation...")
|
| 89 |
try:
|
| 90 |
# Create test tools for validation
|
| 91 |
+
test_tool = type('Tool', (), {'name': 'test_tool', 'description': 'A test tool'})()
|
| 92 |
+
test_tools = {'test_tool': test_tool} # Create a dictionary of tools
|
|
|
|
| 93 |
|
| 94 |
# Validate templates
|
| 95 |
for key, value in prompt_templates.items():
|
|
|
|
| 109 |
# Create a template with the task variable
|
| 110 |
template = Template(template_str, undefined=StrictUndefined)
|
| 111 |
rendered = template.render(
|
| 112 |
+
tools=test_tools, # Pass dictionary of tools
|
| 113 |
task="test",
|
| 114 |
name="test",
|
| 115 |
final_answer="test",
|
|
|
|
| 134 |
# Create a template with the task variable
|
| 135 |
template = Template(template_str, undefined=StrictUndefined)
|
| 136 |
rendered = template.render(
|
| 137 |
+
tools=test_tools, # Pass dictionary of tools
|
| 138 |
task="test",
|
| 139 |
name="test",
|
| 140 |
final_answer="test",
|