🐛 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:
parent
605f7cecb2
commit
f84cd4026a
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue