🐛 fix(loading.py): fix condition to check for "handle_keys" in format_kwargs instead of params

The condition to check for the presence of "handle_keys" has been fixed to correctly check for its existence in the format_kwargs dictionary instead of the params dictionary. This ensures that the "handle_keys" list is properly populated when necessary.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-30 11:23:19 -03:00
commit 0eead8f3f7

View file

@ -157,7 +157,7 @@ def instantiate_prompt(node_type, class_object, params):
isinstance(variable, BaseOutputParser)
and hasattr(variable, "get_format_instructions")
):
if "handle_keys" not in params:
if "handle_keys" not in format_kwargs:
format_kwargs["handle_keys"] = []
# Add the handle_keys to the list