"""Streamlit interface for the barber booking system.""" import streamlit as st from c_langgraph_flow_new import run_booking_flow, SERVICE_MAPPING import os from dotenv import load_dotenv # Load environment variables load_dotenv() def initialize_session(): """Initialize the session state with default values.""" if "messages" not in st.session_state: st.session_state.messages = [] # Add initial greeting st.session_state.messages.append({ "role": "assistant", "content": "Hello! Welcome to our barber shop. I'll help you book an appointment. Could you please tell me your name?" }) if "booking_info" not in st.session_state: st.session_state.booking_info = { "current_node": "Greeting", "booking_info": {}, "response": "", "messages": [] } def main(): st.set_page_config(page_title="AI Barber Booking", page_icon="💇♂️") st.title("💇♂️ AI Barber Booking Assistant") # Initialize session initialize_session() # Display current state (for debugging) with st.sidebar: st.subheader("Debug Information") st.write("Current State:", st.session_state.booking_info.get("current_node", "Unknown")) st.write("\nBooking Info:", st.session_state.booking_info.get("booking_info", {})) if st.checkbox("Show Full Debug Info"): st.json(st.session_state.booking_info) # Display service cards st.markdown("### Our Services") cols = st.columns(len(SERVICE_MAPPING)) for col, (service_name, details) in zip(cols, SERVICE_MAPPING.items()): with col: st.markdown( f"""
${details['price']}
{details['duration']} min