import streamlit as st import difflib from data import kb as techfest_data # --- PAGE CONFIGURATION --- st.set_page_config( page_title="VEDANIX 2K26", page_icon="✨", layout="centered" ) # --- LUXURY UI (CSS) --- st.markdown(""" """, unsafe_allow_html=True) # --- LOGIC FUNCTION --- def get_bot_response(user_input): user_input = user_input.lower() best_match_key = None highest_score = 0 for key, data in techfest_data.items(): for keyword in data["keywords"]: if keyword in user_input: return data["response"] # Fuzzy match similarity = difflib.SequenceMatcher(None, keyword, user_input).ratio() if similarity > 0.6 and similarity > highest_score: highest_score = similarity best_match_key = key if best_match_key and highest_score > 0.6: return techfest_data[best_match_key]["response"] return "🤖 I apologize. I can help with **Schedule**, **Rooms**, **Gaming**, or **Stalls**. Please try a keyword!" # --- MAIN APPLICATION --- def main(): # CUSTOM HTML HEADER (To guarantee Gold Color) st.markdown('

VEDANIX

', unsafe_allow_html=True) st.markdown('
Official AI Companion • 2K26
', unsafe_allow_html=True) # Chat History if "messages" not in st.session_state: st.session_state.messages = [ {"role": "assistant", "content": "✨ **Welcome to VEDANIX.**\n\nI am your event guide. Locate any room, schedule, or event instantly."} ] # Display Messages for message in st.session_state.messages: with st.chat_message(message["role"]): st.markdown(message["content"]) # Input Area if prompt := st.chat_input("Ask about Schedule, Location, or Gaming..."): st.session_state.messages.append({"role": "user", "content": prompt}) with st.chat_message("user"): st.markdown(prompt) response = get_bot_response(prompt) with st.chat_message("assistant"): st.markdown(response) st.session_state.messages.append({"role": "assistant", "content": response}) if __name__ == "__main__": main()