From f84cd4026aa1a0651b7bbdf338599b23a1b08cd3 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 5 Jul 2023 20:09:11 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(validate.py):=20set=20the=20?= =?UTF-8?q?value=20of=20the=20template=20field=20to=20an=20empty=20string?= =?UTF-8?q?=20The=20value=20of=20the=20template=20field=20is=20now=20set?= =?UTF-8?q?=20to=20an=20empty=20string=20to=20ensure=20consistency=20and?= =?UTF-8?q?=20avoid=20potential=20issues=20with=20undefined=20values.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/api/v1/validate.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/langflow/api/v1/validate.py b/src/backend/langflow/api/v1/validate.py index aa3748785..2a5bdd673 100644 --- a/src/backend/langflow/api/v1/validate.py +++ b/src/backend/langflow/api/v1/validate.py @@ -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