Update app.py
Browse files
app.py
CHANGED
@@ -16,16 +16,24 @@ if 'API_Key' not in st.session_state:
|
|
16 |
st.session_state['API_Key'] =''
|
17 |
|
18 |
# Setting page title and header
|
19 |
-
st.set_page_config(page_title="ChatMate: Your Professional AI Conversation Partner", page_icon=":robot_face:")
|
20 |
-
st.markdown("<h1 style='text-align: center;'>
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
st.session_state['API_Key']= st.sidebar.text_input("Enter your OpenAI API Key here please.",type="password")
|
25 |
summarise_button = st.sidebar.button("Summarise the conversation", key="summarise")
|
26 |
if summarise_button:
|
27 |
summarise_placeholder = st.sidebar.write("Nice chatting with you my friend ❤️")
|
28 |
|
|
|
29 |
def getresponse(userInput, api_key):
|
30 |
|
31 |
if st.session_state['conversation'] is None:
|
@@ -54,10 +62,10 @@ response_container = st.container()
|
|
54 |
# Here we will have a container for user input text box
|
55 |
container = st.container()
|
56 |
|
57 |
-
|
58 |
with container:
|
59 |
with st.form(key='my_form', clear_on_submit=True):
|
60 |
-
user_input = st.text_area("
|
61 |
submit_button = st.form_submit_button(label='Send')
|
62 |
|
63 |
if submit_button:
|
|
|
16 |
st.session_state['API_Key'] =''
|
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: Your Professional AI Conversation Partner Solution</h1>", unsafe_allow_html=True)
|
21 |
+
st.markdown("<h4 style='text-align: center;'>Interact with a cutting-edge language model</h4>", unsafe_allow_html=True)
|
22 |
+
|
23 |
+
|
24 |
+
# st.sidebar.title("😎")
|
25 |
+
# Include FontAwesome
|
26 |
+
st.sidebar.title("""
|
27 |
+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css"
|
28 |
+
integrity="sha384-DyZ89p3Do05QyWJgXNBlfano0NqsoFqzY5hVp0SlCbygXpZp1KfdK9MieTZC7XmN"
|
29 |
+
crossorigin="anonymous">
|
30 |
+
""", unsafe_allow_html=True)
|
31 |
st.session_state['API_Key']= st.sidebar.text_input("Enter your OpenAI API Key here please.",type="password")
|
32 |
summarise_button = st.sidebar.button("Summarise the conversation", key="summarise")
|
33 |
if summarise_button:
|
34 |
summarise_placeholder = st.sidebar.write("Nice chatting with you my friend ❤️")
|
35 |
|
36 |
+
# Function to get response from the model
|
37 |
def getresponse(userInput, api_key):
|
38 |
|
39 |
if st.session_state['conversation'] is None:
|
|
|
62 |
# Here we will have a container for user input text box
|
63 |
container = st.container()
|
64 |
|
65 |
+
# User input and response display
|
66 |
with container:
|
67 |
with st.form(key='my_form', clear_on_submit=True):
|
68 |
+
user_input = st.text_area("Ask a question:", key='input', height=100)
|
69 |
submit_button = st.form_submit_button(label='Send')
|
70 |
|
71 |
if submit_button:
|