import streamlit as st st.title("Groq API Chatbot") api_key = st.text_input("Enter Groq API Key", type="password") if "conversation" not in st.session_state: st.session_state.conversation = [] user_input = st.text_input("You: ", "") if st.button("Send"): if user_input and api_key: st.session_state.conversation.append(f"You: {user_input}") # Get the response from Groq API response = get_groq_response(user_input, api_key) st.session_state.conversation.append(f"Bot: {response}") # Display the conversation history for message in st.session_state.conversation: st.write(message)