TTP Restaurant Flavor Test
How it works:
- Uses
TTPChatWidget with flavor: { type: 'restaurants', partnerId: 'mock-restaurant' }
- The backend injects restaurant tools (
search_menu, add_to_order, get_order, show_media)
- Menu item cards display when the agent sends
show_items messages
- Order summary updates on
cart_updated messages (same universal shape as ecommerce: product, cartTotal, cartItemCount)
- Gallery (
show_media) opens fullscreen for dish photos, ambiance, etc.
Loading SDK...
Widget Configuration
Test Actions (Simulated Messages)
Show Menu Items
Injects a show_items message with mock menu items.
Show Gallery
Injects a show_media message to test fullscreen gallery.
Order Updated
Injects an order_updated message to test the order summary bar.
Console Commands
// Access the widget instance
window.testWidget
// Inject messages manually
window.testWidget._flavor.messageHandlers['show_items']({
t: 'show_items',
items: [
{ id: 'MAIN-001', name: 'Grilled Salmon', category: 'Mains', price: 24.99, currency: 'USD', imageUrl: '...', available: true, tags: ['seafood', 'healthy'], allergens: ['fish'] }
],
title: 'Test Menu'
});