import streamlit as st import os from dotenv import load_dotenv import google.generativeai as genai from pathlib import Path import json # Load environment variables load_dotenv() # Configure Gemini API genai.configure(api_key=os.getenv("Gemini_API_Key")) model = genai.GenerativeModel('gemini-pro') # Page config st.set_page_config( page_title="MotiMeter", page_icon="🧊", layout="wide", initial_sidebar_state="expanded" ) # Initialize session state variables if 'role' not in st.session_state: st.session_state.role = None if 'current_mode' not in st.session_state: st.session_state.current_mode = None # Import other modules from tutorial import show_tutorial from live_session import show_live_session from moti_chat import show_moti_chat from session_analysis import show_session_analysis def sidebar(): with st.sidebar: # Role switcher at the top st.session_state.role = st.radio( "Switch Role", ["Consumer", "Therapist"], index=0 if st.session_state.role == "Consumer" else 1 ) st.title("Navigation") # Tutorial button if st.button("Tutorial"): st.session_state.current_mode = "tutorial" # Main navigation st.subheader("Main Features") if st.button("Live Session"): st.session_state.current_mode = "live_session" if st.button("Moti Chat"): st.session_state.current_mode = "moti_chat" if st.button("Session Analysis"): st.session_state.current_mode = "session_analysis" def show_welcome(): # Center align all contents st.markdown(""" """, unsafe_allow_html=True) st.markdown("""

Welcome to MotiMeter

MotiMeter is your AI companion that makes motivational interviewing simple and clear. It listens to therapy conversations and shows both therapists and clients exactly where they are on their change journey - just like a GPS for personal growth.

""", unsafe_allow_html=True) st.write("Please select your role to continue:") col1, col2 = st.columns(2) # Centering the buttons using markdown with col1: st.markdown("
", unsafe_allow_html=True) if st.button("I am a Consumer"): st.session_state.role = "Consumer" st.session_state.current_mode = "tutorial" st.markdown("
", unsafe_allow_html=True) with col2: st.markdown("
", unsafe_allow_html=True) if st.button("I am a Therapist"): st.session_state.role = "Therapist" st.session_state.current_mode = "tutorial" st.markdown("
", unsafe_allow_html=True) # # Create three columns for features # col1, col2, col3 = st.columns(3) # with col1: # st.markdown(""" #
#

🎯 Real-time Analysis

#

Get instant feedback on your MI sessions using advanced AI technology

#
# """, unsafe_allow_html=True) # with col2: # st.markdown(""" #
#

📊 Track Progress

#

Monitor your development and improve your MI skills over time

#
# """, unsafe_allow_html=True) # with col3: # st.markdown(""" #
#

🤝 Interactive Support

#

Practice and enhance your MI techniques with AI guidance

#
# """, unsafe_allow_html=True) # # Add getting started section # st.markdown(""" #
#

Getting Started

#

Upload your session recordings or practice with our AI assistant to improve your MI skills.

#
# """, unsafe_allow_html=True) # Quick start guide with st.expander("📚 Quick Start Guide"): st.markdown(""" ### How to Use MotiMeter 1. **Upload Sessions**: Share your recorded sessions for analysis 2. **Get Feedback**: Receive detailed insights about your MI practice 3. **Track Progress**: Monitor your improvement over time 4. **Practice**: Use our AI assistant to enhance your skills """) def main(): if st.session_state.role is None: show_welcome() else: sidebar() if st.session_state.current_mode == "tutorial": show_tutorial() elif st.session_state.current_mode == "live_session": show_live_session() elif st.session_state.current_mode == "moti_chat": show_moti_chat() elif st.session_state.current_mode == "session_analysis": show_session_analysis() if __name__ == "__main__": main()