Joanna30 commited on
Commit
b14ce1c
·
verified ·
1 Parent(s): e697c6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -20,8 +20,8 @@ st.set_page_config(page_title="Chat GPT Clone", page_icon=":robot_face:")
20
  st.markdown("<h1 style='text-align: center;'>How can I assist you? </h1>", unsafe_allow_html=True)
21
 
22
  # Sidebar for API key input
23
- st.sidebar.title(":D")
24
- st.session_state['API_Key'] = st.sidebar.text_input("Enter your Google API key", type="password", key="google_api_key_input")
25
 
26
  # Summarization button
27
  summarise_button = st.sidebar.button("Summarise the conversation", key="summarise")
@@ -37,11 +37,15 @@ if summarise_button:
37
  # Exclude the first two sentences
38
  filtered_summary = summary_sentences[2:]
39
 
40
- # Display the summary below the button in the sidebar
41
- st.sidebar.markdown("### **Summary of Conversation**")
42
- for i, line in enumerate(filtered_summary):
43
- if line: # Avoid blank lines
44
- st.sidebar.write(f"- {line.strip()}")
 
 
 
 
45
  else:
46
  st.sidebar.write("No conversation history to summarize.")
47
 
 
20
  st.markdown("<h1 style='text-align: center;'>How can I assist you? </h1>", unsafe_allow_html=True)
21
 
22
  # Sidebar for API key input
23
+ st.sidebar.title("To start chatting,")
24
+ st.session_state['API_Key'] = st.sidebar.text_input("Enter your Google API key below", type="password", key="google_api_key_input")
25
 
26
  # Summarization button
27
  summarise_button = st.sidebar.button("Summarise the conversation", key="summarise")
 
37
  # Exclude the first two sentences
38
  filtered_summary = summary_sentences[2:]
39
 
40
+ # Display the summary at the center
41
+ st.markdown("---") # Separator line
42
+ st.markdown("<h3 style='text-align: center;'>Summary of Conversation</h3>", unsafe_allow_html=True)
43
+
44
+ summary_container = st.container()
45
+ with summary_container:
46
+ for i, line in enumerate(filtered_summary):
47
+ if line: # Avoid blank lines
48
+ message(line, is_user=False, key=f"summary_{i}")
49
  else:
50
  st.sidebar.write("No conversation history to summarize.")
51