🔧 chore(utils.py): refactor build_input_keys_response function to return an empty string for each input key

The build_input_keys_response function has been refactored to return an empty string for each input key in the langchain_object. This change ensures consistency in the response structure and provides a default value for each input key.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-28 11:44:07 -03:00
commit 5a76d36cd4

View file

@ -26,8 +26,9 @@ def remove_api_keys(flow: dict):
def build_input_keys_response(langchain_object): def build_input_keys_response(langchain_object):
"""Build the input keys response.""" """Build the input keys response."""
input_keys_response = { input_keys_response = {
"input_keys": langchain_object.input_keys, "input_keys": {key: "" for key in langchain_object.input_keys},
"memory_keys": [], "memory_keys": [],
} }
# If the object has memory, that memory will have a memory_variables attribute # If the object has memory, that memory will have a memory_variables attribute