Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,11 @@ with st.sidebar:
|
|
| 15 |
dubs_key = st.text_input("Enter Dubs Key", key="chatbot_api_key", type="password")
|
| 16 |
st.markdown("### Dubs Recall")
|
| 17 |
st.markdown("Coming Soon!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Template for serializing chat history
|
| 20 |
CHAT_TEMPLATE = """
|
|
@@ -79,6 +84,7 @@ def call_api(chat_history):
|
|
| 79 |
# Chat History Initialization
|
| 80 |
if "messages" not in st.session_state:
|
| 81 |
st.session_state["messages"] = [
|
|
|
|
| 82 |
{"role": "assistant", "content": "Hello! How can I assist you today?"}
|
| 83 |
]
|
| 84 |
|
|
|
|
| 15 |
dubs_key = st.text_input("Enter Dubs Key", key="chatbot_api_key", type="password")
|
| 16 |
st.markdown("### Dubs Recall")
|
| 17 |
st.markdown("Coming Soon!")
|
| 18 |
+
if st.button("🔄 New Chat"):
|
| 19 |
+
st.session_state["messages"] = [
|
| 20 |
+
{"role": "system", "content": "You are DUBS, a helpful assistant capable of conversing in a friendly and knowledgeable way."},
|
| 21 |
+
{"role": "assistant", "content": "Hello! How can I assist you today?"}
|
| 22 |
+
]
|
| 23 |
|
| 24 |
# Template for serializing chat history
|
| 25 |
CHAT_TEMPLATE = """
|
|
|
|
| 84 |
# Chat History Initialization
|
| 85 |
if "messages" not in st.session_state:
|
| 86 |
st.session_state["messages"] = [
|
| 87 |
+
{"role": "system", "content": "You are DUBS, a helpful assistant capable of conversing in a friendly and knowledgeable way."},
|
| 88 |
{"role": "assistant", "content": "Hello! How can I assist you today?"}
|
| 89 |
]
|
| 90 |
|