🐛 fix(validate.py): set the value of the template field to an empty string

The value of the template field is now set to an empty string to ensure consistency and avoid potential issues with undefined values.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-05 20:09:11 -03:00
commit f84cd4026a

View file

@ -73,12 +73,14 @@ def add_new_variables_to_template(input_variables, prompt_request):
advanced=False,
multiline=True,
input_types=["Document", "BaseOutputParser"],
value="", # Set the value to empty string
)
if variable in prompt_request.frontend_node.template:
# Set the new field with the old value
template_field.value = prompt_request.frontend_node.template[variable][
"value"
]
prompt_request.frontend_node.template[variable] = template_field.to_dict()
# Check if variable is not already in the list before appending