Mpavan45 commited on
Commit
ba78ae1
Β·
verified Β·
1 Parent(s): 79c6bb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -10
app.py CHANGED
@@ -78,11 +78,14 @@ def animated_text(text, speed=0.05):
78
 
79
  for letter in text:
80
  displayed_text += letter
81
- placeholder.markdown(f"""<h1 class='title-text; color: #00D1FF;'>{displayed_text} πŸš€</h1>""", unsafe_allow_html=True)
 
 
82
  time.sleep(speed)
 
83
 
84
  # πŸ”Ή **Display Animated Welcome Message**
85
- animated_text("Welcome to Gemini Data Science Tutor!")
86
 
87
 
88
  # Get session ID
@@ -126,15 +129,18 @@ with chat_container:
126
  for role, content in st.session_state.messages:
127
  with st.chat_message(role):
128
  st.markdown(content)
129
-
130
- # "New Chat" button
131
- if st.button("πŸ†• New Chat"):
132
- st.session_state.session_id = str(uuid.uuid4()) # Generate new session ID
133
- st.session_state.messages = [] # Clear chat history
134
- st.rerun() # Refresh the app
 
135
 
136
- # πŸ”Ή **Fixed Bottom User Input**
137
- user_input = st.text_input("Type your message here:", key="user_message")
 
 
138
 
139
  # If user submits a message
140
  if user_input:
 
78
 
79
  for letter in text:
80
  displayed_text += letter
81
+ placeholder.markdown(f"""
82
+ <h1 style="text-align:center; color: #00D1FF;">{displayed_text} πŸš€</h1>
83
+ """, unsafe_allow_html=True) # Corrected f-string formatting
84
  time.sleep(speed)
85
+
86
 
87
  # πŸ”Ή **Display Animated Welcome Message**
88
+ animated_text(""Conversational AI Data Science Tutor"")
89
 
90
 
91
  # Get session ID
 
129
  for role, content in st.session_state.messages:
130
  with st.chat_message(role):
131
  st.markdown(content)
132
+ # "New Chat" button (Right Side of Input Box)
133
+ col1, col2 = st.columns([4, 1])
134
+ with col2:
135
+ if st.button("πŸ†• New Chat"):
136
+ st.session_state.session_id = str(uuid.uuid4()) # Generate new session
137
+ st.session_state.messages = [] # Clear chat history
138
+ st.rerun() # Refresh the app
139
 
140
+ # User input at the bottom
141
+ with col1:
142
+ # πŸ”Ή **Fixed Bottom User Input**
143
+ user_input = st.text_input("Type your message here:", key="user_message")
144
 
145
  # If user submits a message
146
  if user_input: