Formatting

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-09-19 15:27:12 -03:00
commit 2b454dc645
5 changed files with 37 additions and 27 deletions

View file

@ -59,7 +59,7 @@ def get_memory_key(langchain_object):
"history": "chat_history",
}
# Check if memory_key attribute exists
if hasattr(langchain_object.memory, 'memory_key'):
if hasattr(langchain_object.memory, "memory_key"):
memory_key = langchain_object.memory.memory_key
return mem_key_dict.get(memory_key)
else:
@ -90,5 +90,4 @@ def update_memory_keys(langchain_object, possible_new_mem_key):
try:
setattr(langchain_object.memory, attr, key)
except ValueError as exc:
logger.debug(
f"{langchain_object.memory} has no attribute {attr} ({exc})")
logger.debug(f"{langchain_object.memory} has no attribute {attr} ({exc})")