Update app.py
Browse files
app.py
CHANGED
|
@@ -17,13 +17,13 @@ if 'API_Key' not in st.session_state:
|
|
| 17 |
|
| 18 |
# Setting page title and header
|
| 19 |
st.set_page_config(page_title="ChatMate: Your Professional AI Conversation Partner Solution", page_icon=":robot_face:")
|
| 20 |
-
st.markdown("<h1 style='text-align: center; color: navy;'>ChatMate
|
| 21 |
-
st.markdown("<h4 style='text-align: center;'>
|
| 22 |
|
| 23 |
# API Keys
|
| 24 |
# st.sidebar.text_input() will automatically update st.session_state['API_Key'] with the input value whenever the user types into the field.
|
| 25 |
st.sidebar.title("🔑")
|
| 26 |
-
st.session_state['API_Key']= st.sidebar.text_input("
|
| 27 |
|
| 28 |
# summarise_button = st.sidebar.button("Summarise the conversation", key="summarise")
|
| 29 |
#if summarise_button:
|
|
@@ -70,12 +70,12 @@ with container:
|
|
| 70 |
st.session_state['messages'].append(model_response)
|
| 71 |
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
|
| 80 |
with response_container:
|
| 81 |
for i in range(len(st.session_state['messages'])):
|
|
|
|
| 17 |
|
| 18 |
# Setting page title and header
|
| 19 |
st.set_page_config(page_title="ChatMate: Your Professional AI Conversation Partner Solution", page_icon=":robot_face:")
|
| 20 |
+
st.markdown("<h1 style='text-align: center; color: navy;'>ChatMate</h1>", unsafe_allow_html=True)
|
| 21 |
+
st.markdown("<h4 style='text-align: center;'>A cutting-edge language model</h4>", unsafe_allow_html=True)
|
| 22 |
|
| 23 |
# API Keys
|
| 24 |
# st.sidebar.text_input() will automatically update st.session_state['API_Key'] with the input value whenever the user types into the field.
|
| 25 |
st.sidebar.title("🔑")
|
| 26 |
+
st.session_state['API_Key']= st.sidebar.text_input("Put your OpenAI API Key here please, the system will enter for you automatically.",type="password")
|
| 27 |
|
| 28 |
# summarise_button = st.sidebar.button("Summarise the conversation", key="summarise")
|
| 29 |
#if summarise_button:
|
|
|
|
| 70 |
st.session_state['messages'].append(model_response)
|
| 71 |
|
| 72 |
|
| 73 |
+
with response_container:
|
| 74 |
+
for i in range(len(st.session_state['messages'])):
|
| 75 |
+
if (i % 2) == 0:
|
| 76 |
+
message(st.session_state['messages'][i], is_user=True, key=str(i) + '_user')
|
| 77 |
+
else:
|
| 78 |
+
message(st.session_state['messages'][i], key=str(i) + '_AI')
|
| 79 |
|
| 80 |
with response_container:
|
| 81 |
for i in range(len(st.session_state['messages'])):
|