diff --git a/src/backend/langflow/api/v1/chat.py b/src/backend/langflow/api/v1/chat.py index 44ea0ca8a..de3c33e01 100644 --- a/src/backend/langflow/api/v1/chat.py +++ b/src/backend/langflow/api/v1/chat.py @@ -128,6 +128,8 @@ async def stream_build(flow_id: str): yield str(StreamData(event="message", data=input_keys_response)) chat_manager.set_cache(flow_id, langchain_object) + # We need to reset the chat history + chat_manager.chat_history.empty_history(flow_id) except Exception as exc: logger.error("Error while building the flow: %s", exc) yield str(StreamData(event="error", data={"error": str(exc)}))