From 2efa63b3599436f619cf0c77cba6067d8c34426d Mon Sep 17 00:00:00 2001 From: kaushal Date: Thu, 12 Feb 2026 09:42:32 +0530 Subject: [PATCH] Fix: preserve original capitalization in user input while using normalized input for comparisons --- streamly.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/streamly.py b/streamly.py index 45bc437..4f50a91 100644 --- a/streamly.py +++ b/streamly.py @@ -199,7 +199,9 @@ def on_chat_submit(chat_input, latest_updates): Returns: - None: Updates the chat history in Streamlit's session state. """ - user_input = chat_input.strip().lower() + user_input = chat_input.strip() + normalized_input = user_input.lower() + if 'conversation_history' not in st.session_state: st.session_state.conversation_history = initialize_conversation() @@ -210,7 +212,7 @@ def on_chat_submit(chat_input, latest_updates): model_engine = "gpt-4o-mini" assistant_reply = "" - if "latest updates" in user_input: + if "latest updates" in normalized_input: assistant_reply = "Here are the latest highlights from Streamlit:\n" highlights = latest_updates.get("Highlights", {}) if highlights: