Spaces:
Runtime error
Runtime error
Scott Cogan commited on
Commit ·
f32faf3
1
Parent(s): 4387720
fix: ensure all templates have at least one template node
Browse files
app.py
CHANGED
|
@@ -97,7 +97,12 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 97 |
|
| 98 |
# Validate template
|
| 99 |
try:
|
| 100 |
-
template
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
rendered = template.render(
|
| 102 |
tools=[],
|
| 103 |
task="test",
|
|
@@ -116,7 +121,12 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 116 |
|
| 117 |
# Validate template
|
| 118 |
try:
|
| 119 |
-
template
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
rendered = template.render(
|
| 121 |
tools=[],
|
| 122 |
task="test",
|
|
|
|
| 97 |
|
| 98 |
# Validate template
|
| 99 |
try:
|
| 100 |
+
# Create a template with at least one template node
|
| 101 |
+
template_str = subvalue
|
| 102 |
+
if '{{' not in template_str and '{%' not in template_str:
|
| 103 |
+
template_str = "{{ task }}\n" + template_str
|
| 104 |
+
|
| 105 |
+
template = Template(template_str, undefined=StrictUndefined)
|
| 106 |
rendered = template.render(
|
| 107 |
tools=[],
|
| 108 |
task="test",
|
|
|
|
| 121 |
|
| 122 |
# Validate template
|
| 123 |
try:
|
| 124 |
+
# Create a template with at least one template node
|
| 125 |
+
template_str = value
|
| 126 |
+
if '{{' not in template_str and '{%' not in template_str:
|
| 127 |
+
template_str = "{{ task }}\n" + template_str
|
| 128 |
+
|
| 129 |
+
template = Template(template_str, undefined=StrictUndefined)
|
| 130 |
rendered = template.render(
|
| 131 |
tools=[],
|
| 132 |
task="test",
|