Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io

This commit is contained in:
Lucas Oliveira 2023-06-30 11:25:05 -03:00
commit 3937b30e16

View file

@ -149,7 +149,15 @@ def instantiate_prompt(node_type, class_object, params):
)
# handle_keys will be a list but it does not exist yet
# so we need to create it
if "handle_keys" not in params:
if (
isinstance(variable, List)
and all(isinstance(item, Document) for item in variable)
) or (
isinstance(variable, BaseOutputParser)
and hasattr(variable, "get_format_instructions")
):
if "handle_keys" not in format_kwargs:
format_kwargs["handle_keys"] = []
# Add the handle_keys to the list