🐛 fix(loading.py): handle case when "handle_keys" is not in params dictionary and add input_variable to "handle_keys" list
The code now checks if the "handle_keys" key is present in the params dictionary. If it is not present, it creates an empty list and adds the input_variable to it. This ensures that the "handle_keys" list is always present and the input_variable is correctly added to it.
This commit is contained in:
parent
d6bd8a1a1b
commit
1743edfd1d
1 changed files with 7 additions and 0 deletions
|
|
@ -142,6 +142,13 @@ def instantiate_prompt(node_type, class_object, params):
|
|||
for item in variable
|
||||
]
|
||||
)
|
||||
# handle_keys will be a list but it does not exist yet
|
||||
# so we need to create it
|
||||
if "handle_keys" not in params:
|
||||
format_kwargs["handle_keys"] = []
|
||||
|
||||
# Add the handle_keys to the list
|
||||
format_kwargs["handle_keys"].append(input_variable)
|
||||
|
||||
return prompt, format_kwargs
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue