Anshini commited on
Commit
59b9d1f
Β·
verified Β·
1 Parent(s): 0fff9f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -132,12 +132,11 @@ elif st.session_state.page == "sql":
132
 
133
  # Streamlit A
134
 
135
- st.markdown("Ask anything related to SQL interviews!")
136
 
137
  # Initialize chat history
138
  if "messages" not in st.session_state:
139
- st.session_state.messages = [SystemMessage(content="Answer clearly like a technical SQL interviewer.")
140
- ]
141
 
142
  # User input
143
  user_input = st.text_input("πŸ’‘ Ask your SQL interview question:", placeholder="e.g., give me 10 SQL interview questions with answers")
@@ -155,14 +154,14 @@ st.markdown("Ask anything related to SQL interviews!")
155
  st.markdown(f"**Answer:** {answer}")
156
 
157
  # Show chat history
158
- st.markdown("### πŸ“œ Chat History")
159
- for msg in st.session_state.messages[1:]: # Skip SystemMessage
160
- if isinstance(msg, HumanMessage):
161
- st.markdown(f"**You:** {msg.content}")
162
- elif isinstance(msg, AIMessage):
163
- st.markdown(f"**Bot:** {msg.content}")
164
- st.button("⬅️ Back to Home", on_click=lambda: switch_page("home"))
165
- # Load SQL chatbot here
166
 
167
  elif st.session_state.page == "powerbi":
168
  st.title("Power BI Chatbot πŸ“Š")
 
132
 
133
  # Streamlit A
134
 
135
+ st.markdown("Ask anything related to SQL interviews!")
136
 
137
  # Initialize chat history
138
  if "messages" not in st.session_state:
139
+ st.session_state.messages = [SystemMessage(content="Answer clearly like a technical SQL interviewer.")]
 
140
 
141
  # User input
142
  user_input = st.text_input("πŸ’‘ Ask your SQL interview question:", placeholder="e.g., give me 10 SQL interview questions with answers")
 
154
  st.markdown(f"**Answer:** {answer}")
155
 
156
  # Show chat history
157
+ st.markdown("### πŸ“œ Chat History")
158
+ for msg in st.session_state.messages[1:]: # Skip SystemMessage
159
+ if isinstance(msg, HumanMessage):
160
+ st.markdown(f"**You:** {msg.content}")
161
+ elif isinstance(msg, AIMessage):
162
+ st.markdown(f"**Bot:** {msg.content}")
163
+ st.button("⬅️ Back to Home", on_click=lambda: switch_page("home"))
164
+ # Load SQL chatbot here
165
 
166
  elif st.session_state.page == "powerbi":
167
  st.title("Power BI Chatbot πŸ“Š")