Mpavan45 commited on
Commit
7e5c4c4
·
verified ·
1 Parent(s): 5f90ea2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -5,7 +5,12 @@ import google.generativeai as genai
5
  st.markdown("""
6
  <h1 style="text-align:center; color: #FF4500;">Welcome To Gemini CodeReviewer.....</h1>
7
  """, unsafe_allow_html=True)
8
- # Move this line to the top before any Streamlit UI commands
 
 
 
 
 
9
  st.set_page_config(page_title="Gemini Chatbot", layout="centered")
10
 
11
  # Configure Gemini API Key
@@ -30,16 +35,11 @@ for message in st.session_state.messages:
30
  user_input = st.chat_input("Type your message...")
31
 
32
  if user_input:
33
- # Display user message
34
  st.session_state.messages.append({"role": "user", "content": user_input})
35
  with st.chat_message("user"):
36
  st.markdown(user_input)
37
 
38
- # Get response from Gemini API
39
  response = get_gemini_response(user_input)
40
-
41
- # Display bot response
42
  st.session_state.messages.append({"role": "assistant", "content": response})
43
  with st.chat_message("assistant"):
44
  st.markdown(response)
45
-
 
5
  st.markdown("""
6
  <h1 style="text-align:center; color: #FF4500;">Welcome To Gemini CodeReviewer.....</h1>
7
  """, unsafe_allow_html=True)
8
+
9
+
10
+ import streamlit as st
11
+ import google.generativeai as genai
12
+
13
+ # ✅ Ensure this is the first Streamlit command
14
  st.set_page_config(page_title="Gemini Chatbot", layout="centered")
15
 
16
  # Configure Gemini API Key
 
35
  user_input = st.chat_input("Type your message...")
36
 
37
  if user_input:
 
38
  st.session_state.messages.append({"role": "user", "content": user_input})
39
  with st.chat_message("user"):
40
  st.markdown(user_input)
41
 
 
42
  response = get_gemini_response(user_input)
 
 
43
  st.session_state.messages.append({"role": "assistant", "content": response})
44
  with st.chat_message("assistant"):
45
  st.markdown(response)