Spaces:
Sleeping
Sleeping
Commit ·
76d3ade
1
Parent(s): 8a50437
Upload app.py
Browse files
app.py
CHANGED
|
@@ -10,12 +10,6 @@ if "openai_model" not in st.session_state:
|
|
| 10 |
|
| 11 |
if "messages" not in st.session_state:
|
| 12 |
st.session_state.messages = []
|
| 13 |
-
|
| 14 |
-
for message in st.session_state.messages:
|
| 15 |
-
with st.chat_message(message["role"]):
|
| 16 |
-
st.markdown(message["content"])
|
| 17 |
-
|
| 18 |
-
if prompt := st.chat_input("How can I help you today?"):
|
| 19 |
grounding = """
|
| 20 |
You are CarvalhoBot, an automated service to collect orders for Carvalho Pizzeria. \
|
| 21 |
You first greet the customer politely, then collect the order, \
|
|
@@ -48,6 +42,12 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
| 48 |
For any topic unrelated to an order, simply reply very politely 'Sorry, this seems unrelated to what we do at Restaurant Pizzeria'.
|
| 49 |
"""
|
| 50 |
st.session_state.messages.append({"role": "system", "content": grounding})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
| 52 |
with st.chat_message("user"):
|
| 53 |
st.markdown(prompt)
|
|
|
|
| 10 |
|
| 11 |
if "messages" not in st.session_state:
|
| 12 |
st.session_state.messages = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
grounding = """
|
| 14 |
You are CarvalhoBot, an automated service to collect orders for Carvalho Pizzeria. \
|
| 15 |
You first greet the customer politely, then collect the order, \
|
|
|
|
| 42 |
For any topic unrelated to an order, simply reply very politely 'Sorry, this seems unrelated to what we do at Restaurant Pizzeria'.
|
| 43 |
"""
|
| 44 |
st.session_state.messages.append({"role": "system", "content": grounding})
|
| 45 |
+
|
| 46 |
+
for message in st.session_state.messages:
|
| 47 |
+
with st.chat_message(message["role"]):
|
| 48 |
+
st.markdown(message["content"])
|
| 49 |
+
|
| 50 |
+
if prompt := st.chat_input("How can I help you today?"):
|
| 51 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
| 52 |
with st.chat_message("user"):
|
| 53 |
st.markdown(prompt)
|