From 9f8b474a36b19fb4884bb9bb035bb2c3a43be8f5 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Tue, 25 Apr 2023 22:06:26 -0300 Subject: [PATCH] refactor(chat_manager.py): prevent notification when message is a FileResponse instance --- src/backend/langflow/api/chat_manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/api/chat_manager.py b/src/backend/langflow/api/chat_manager.py index 8e05127fe..cafa6bb5f 100644 --- a/src/backend/langflow/api/chat_manager.py +++ b/src/backend/langflow/api/chat_manager.py @@ -23,7 +23,8 @@ class ChatHistory(Subject): """Add a message to the chat history.""" self.history[client_id].append(message) - self.notify() + if not isinstance(message, FileResponse): + self.notify() def get_history(self, client_id: str, filter=True) -> List[ChatMessage]: """Get the chat history for a client."""