refactor(chat_manager.py): remove redundant or condition in line 129

feat(chat_manager.py): add strip() method to intermediate_steps to remove leading/trailing whitespaces
This commit is contained in:
Gabriel Almeida 2023-04-25 20:50:49 -03:00
commit 42a17e3aaf

View file

@ -126,9 +126,10 @@ class ChatManager:
logger.exception(e)
raise e
# Send a response back to the frontend, if needed
intermediate_steps = intermediate_steps or ""
response = ChatResponse(
message=result or "",
intermediate_steps=intermediate_steps or "",
intermediate_steps=intermediate_steps.strip(),
type="end",
)
self.chat_history.add_message(client_id, response)