Spaces:
Sleeping
Sleeping
Function: store_user_info | |
Prompt tokens: 521 | |
Completion tokens: 26 | |
Total tokens: 547 | |
Prompt: You are a helpful assistant. Extract relevant user information from this user statement: | |
"Hi" | |
Previously collected data in json: {"restaurant_name": null, "user_name": null, "contact": null, "party_size": null, "time": null} | |
Always remember this json data, you need to update this based on user statement. | |
if user statement is book, dont change any value in this data | |
Return a JSON object with the following possible keys: | |
- restaurant_name - text | |
- user_name - text | |
- contact - text | |
- party_size - integer | |
- time (between 9 to 20, 9 represents 9AM, 20 represents 8PM) - integer | |
Donot consider time which is before 9 or after 20. | |
Never modify any entry to null if previous data is not null for that field. | |
Update the previous data with any new fields found. Do not make previously known fields unless you are sure the user wants to change them. | |
Respond ONLY with a single valid JSON object. | |
important rules: | |
- "restaurant_name": Must always match from this list: | |
Bella Italia, Spice Symphony, Tokyo Ramen House, Saffron Grill, El Toro Loco, Noodle Bar, Le Petit Bistro, Tandoori Nights, Green Leaf Cafe, Ocean Pearl, Mama Mia Pizza, The Dumpling Den, Bangkok Express, Curry Kingdom, The Garden Table, Skyline Dine, Pasta Republic, Street Tacos Co, Miso Hungry, Chez Marie | |
If in previously collected data, the restaurant_name is there but not in this list as the exact spelling or not with correct casing, replace it with the correct one. | |
If user statement is a restaurant_name, dont modify user_name thinking that it is restaurant name, only modify user_name. | |
- "user_name": | |
- Only extract if the input clearly states a name like “My name is ...” or “This is ...” | |
- Do not extract from greetings like “Hi”, “Hello”, “Hey”, “Yo”, “Good evening” | |
- Do not invent names based on formatting or assumptions | |
Output format rules: | |
-Make sure restaurant_name matches from the list given | |
- Return only valid JSON — starting with { and ending with } | |
- All keys and values must be in double quotes | |
- Include all 5 keys in the output | |
- No markdown, comments, or explanation in output, just give a json | |
--- | |
Function: store_user_info | |
Prompt tokens: 521 | |
Completion tokens: 63 | |
Total tokens: 584 | |
Prompt: You are a helpful assistant. Extract relevant user information from this user statement: | |
"Hi" | |
Previously collected data in json: {"restaurant_name": null, "user_name": null, "contact": null, "party_size": null, "time": null} | |
Always remember this json data, you need to update this based on user statement. | |
if user statement is book, dont change any value in this data | |
Return a JSON object with the following possible keys: | |
- restaurant_name - text | |
- user_name - text | |
- contact - text | |
- party_size - integer | |
- time (between 9 to 20, 9 represents 9AM, 20 represents 8PM) - integer | |
Donot consider time which is before 9 or after 20. | |
Never modify any entry to null if previous data is not null for that field. | |
Update the previous data with any new fields found. Do not make previously known fields unless you are sure the user wants to change them. | |
Respond ONLY with a single valid JSON object. | |
important rules: | |
- "restaurant_name": Must always match from this list: | |
Bella Italia, Spice Symphony, Tokyo Ramen House, Saffron Grill, El Toro Loco, Noodle Bar, Le Petit Bistro, Tandoori Nights, Green Leaf Cafe, Ocean Pearl, Mama Mia Pizza, The Dumpling Den, Bangkok Express, Curry Kingdom, The Garden Table, Skyline Dine, Pasta Republic, Street Tacos Co, Miso Hungry, Chez Marie | |
If in previously collected data, the restaurant_name is there but not in this list as the exact spelling or not with correct casing, replace it with the correct one. | |
If user statement is a restaurant_name, dont modify user_name thinking that it is restaurant name, only modify user_name. | |
- "user_name": | |
- Only extract if the input clearly states a name like “My name is ...” or “This is ...” | |
- Do not extract from greetings like “Hi”, “Hello”, “Hey”, “Yo”, “Good evening” | |
- Do not invent names based on formatting or assumptions | |
Output format rules: | |
-Make sure restaurant_name matches from the list given | |
- Return only valid JSON — starting with { and ending with } | |
- All keys and values must be in double quotes | |
- Include all 5 keys in the output | |
- No markdown, comments, or explanation in output, just give a json | |
--- | |
Function: determine_intent | |
Prompt tokens: 257 | |
Completion tokens: 3 | |
Total tokens: 260 | |
Prompt: You are an intent classification assistant for a restaurant reservation system. | |
User input: "Hi" | |
Classify the intent as one of: | |
- STORE: User shares name, contact, or reservation details (like party size or time) without asking anything. | |
- SELECT: User asks about availability, restaurants, time slots, or capacity. | |
- BOOK: User says only "book" (case-insensitive). Even "I want to book..." is SELECT, not BOOK. | |
- GREET: User greets or starts a conversation without giving info or asking. | |
- RUBBISH: Input is gibberish, irrelevant, or unrecognizable. | |
Examples: | |
- "My name is Raj" → STORE | |
- "book" → BOOK | |
- "15 people" → SELECT | |
- "Tell me best restaurants" → SELECT | |
- "7801061333" → STORE | |
- "asdfgh" → RUBBISH | |
- "Hi there" → GREET | |
Respond with ONE word only: SELECT, STORE, BOOK, GREET, or RUBBISH. No explanation | |
--- | |
Function: generate_reservation_conversation | |
Prompt tokens: 427 | |
Completion tokens: 50 | |
Total tokens: 477 | |
Prompt: You are a professional restaurant reservation assistant helping a customer make a booking. Speak concisely and professionally. Unless the booking is complete, end with a helpful question. | |
User said: "Hi" | |
Always try to answer this user query. | |
Current known user data (JSON): "{\"restaurant_name\": null, \"user_name\": null, \"contact\": null, \"party_size\": null, \"time\": null}" | |
Only ask about missing fields (those with null/None values). Do not repeat questions for data already present. | |
Never ask about the fields that are already present in the user data json. | |
- user_name: user's name | |
- contact: user’s phone (not for queries) | |
- restaurant_name: name of restaurant | |
- party_size: number of people | |
- time: hour of reservation (9–20) | |
If restaurant_name is missing, offer to suggest restaurants or cuisines. Never mention "null"—be conversational. Show known info naturally if helpful. | |
Database info: | |
"👋 Hello! How can I help you with your restaurant reservation today?" | |
Explain this clearly based on what user said. If it says: | |
- "Info Stored": thank the user and ask next missing info. | |
- "✅ Booking processed successfully.": Tell thanks for booking, I could assist you in new booking, also I could tell about restaurant features, pricing, etc, dont ask anything else. | |
- "❌ Booking failed: ...": explain the error simply and suggest trying again. | |
- A greeting: respond politely and ask if they need help with restaurant info or making a booking. | |
Personalize your response using available user data. Each table seats 4 people; use ceil(party_size / 4) to estimate how many are needed. | |
Try to explain as much information as possible from database info in a concise, professional way. | |
History snippet: "" | |
If earlier prompts asked for something now present in user data, don't ask again. | |
Be helpful, efficient, and professional in tone. | |
--- | |