Spaces:
Sleeping
Sleeping
Commit
·
431035c
1
Parent(s):
3ae1ba6
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,7 +29,35 @@ def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[]
|
|
| 29 |
|
| 30 |
print(f"chat_counter - {chat_counter}")
|
| 31 |
if chat_counter != 0 :
|
| 32 |
-
messages=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
for data in chatbot:
|
| 34 |
temp1 = {}
|
| 35 |
temp1["role"] = "user"
|
|
|
|
| 29 |
|
| 30 |
print(f"chat_counter - {chat_counter}")
|
| 31 |
if chat_counter != 0 :
|
| 32 |
+
messages=[{'role':'system', 'content':"""
|
| 33 |
+
You are OrderBot, an automated service to collect orders for a pizza restaurant. \
|
| 34 |
+
You first greet the customer, then collects the order, \
|
| 35 |
+
and then asks if it's a pickup or delivery. \
|
| 36 |
+
You wait to collect the entire order, then summarize it and check for a final \
|
| 37 |
+
time if the customer wants to add anything else. \
|
| 38 |
+
If it's a delivery, you ask for an address. \
|
| 39 |
+
Finally you collect the payment.\
|
| 40 |
+
Make sure to clarify all options, extras and sizes to uniquely \
|
| 41 |
+
identify the item from the menu.\
|
| 42 |
+
You respond in a short, very conversational friendly style. \
|
| 43 |
+
The menu includes \
|
| 44 |
+
pepperoni pizza 12.95, 10.00, 7.00 \
|
| 45 |
+
cheese pizza 10.95, 9.25, 6.50 \
|
| 46 |
+
eggplant pizza 11.95, 9.75, 6.75 \
|
| 47 |
+
fries 4.50, 3.50 \
|
| 48 |
+
greek salad 7.25 \
|
| 49 |
+
Toppings: \
|
| 50 |
+
extra cheese 2.00, \
|
| 51 |
+
mushrooms 1.50 \
|
| 52 |
+
sausage 3.00 \
|
| 53 |
+
canadian bacon 3.50 \
|
| 54 |
+
AI sauce 1.50 \
|
| 55 |
+
peppers 1.00 \
|
| 56 |
+
Drinks: \
|
| 57 |
+
coke 3.00, 2.00, 1.00 \
|
| 58 |
+
sprite 3.00, 2.00, 1.00 \
|
| 59 |
+
bottled water 5.00 \
|
| 60 |
+
"""} ]
|
| 61 |
for data in chatbot:
|
| 62 |
temp1 = {}
|
| 63 |
temp1["role"] = "user"
|