Add example DM scenarios
Browse files
app.py
CHANGED
|
@@ -96,6 +96,31 @@ Lena: Do you still have lemon bars? I need some for tomorrow but not sure how ma
|
|
| 96 |
Chris: 12 cookies please, pickup at the farmers market. Paid already.
|
| 97 |
"""
|
| 98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
def extract_json(text):
|
| 100 |
start = text.find("{")
|
| 101 |
end = text.rfind("}")
|
|
@@ -363,6 +388,11 @@ with gr.Blocks(title="DM Order Desk") as demo:
|
|
| 363 |
lines=14,
|
| 364 |
)
|
| 365 |
run = gr.Button("Organize orders", variant="primary")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 366 |
|
| 367 |
with gr.Column(scale=2):
|
| 368 |
orders = gr.Dataframe(label="Order sheet", headers=ORDER_COLUMNS)
|
|
|
|
| 96 |
Chris: 12 cookies please, pickup at the farmers market. Paid already.
|
| 97 |
"""
|
| 98 |
|
| 99 |
+
FOOD_TRUCK_EXAMPLE = """Alex: Can I get 3 chicken tacos for pickup at 6:30 tonight? Paid on Cash App.
|
| 100 |
+
Jamie: Do you still have vegan bowls? Need 2 tomorrow for office lunch.
|
| 101 |
+
Priya: One brisket sandwich, no onions. I'll pick up at the truck on Main Street.
|
| 102 |
+
Nate: 4 lemonades for the soccer team, pickup after practice.
|
| 103 |
+
"""
|
| 104 |
+
|
| 105 |
+
CRAFT_SELLER_EXAMPLE = """Olivia: I want 2 custom mugs with blue initials. Can you ship to 18 Pine Road?
|
| 106 |
+
Ben: Need one candle gift box for Saturday. Lavender if you have it.
|
| 107 |
+
Rosa: Can I order 3 tote bags? I can pick up at the market.
|
| 108 |
+
Eli: Do you still make birthday stickers? Need some next week but not sure how many.
|
| 109 |
+
"""
|
| 110 |
+
|
| 111 |
+
FARMERS_MARKET_EXAMPLE = """Grace: Can you hold 2 sourdough loaves for Sunday pickup?
|
| 112 |
+
Leo: I need 1 jar of strawberry jam and 2 honey bottles. Paid already.
|
| 113 |
+
Mina: Do you have eggs this weekend? Maybe 2 dozen if available.
|
| 114 |
+
Noah: Please save me 3 bags of granola, pickup at the farmers market.
|
| 115 |
+
"""
|
| 116 |
+
|
| 117 |
+
EXAMPLES = [
|
| 118 |
+
[EXAMPLE_INPUT],
|
| 119 |
+
[FOOD_TRUCK_EXAMPLE],
|
| 120 |
+
[CRAFT_SELLER_EXAMPLE],
|
| 121 |
+
[FARMERS_MARKET_EXAMPLE],
|
| 122 |
+
]
|
| 123 |
+
|
| 124 |
def extract_json(text):
|
| 125 |
start = text.find("{")
|
| 126 |
end = text.rfind("}")
|
|
|
|
| 388 |
lines=14,
|
| 389 |
)
|
| 390 |
run = gr.Button("Organize orders", variant="primary")
|
| 391 |
+
gr.Examples(
|
| 392 |
+
examples=EXAMPLES,
|
| 393 |
+
inputs=messages,
|
| 394 |
+
label="Try example DMs",
|
| 395 |
+
)
|
| 396 |
|
| 397 |
with gr.Column(scale=2):
|
| 398 |
orders = gr.Dataframe(label="Order sheet", headers=ORDER_COLUMNS)
|