Explicit Toast subcategory instructions: parent in category, subcat in subcategory

This commit is contained in:
John Mizerek 2026-02-12 19:44:10 -08:00
parent 436861970e
commit 549f3cb31f

View file

@ -267,7 +267,7 @@
<cfset arrayAppend(response.steps, "Found " & arrayLen(h3Texts) & " h3 and " & arrayLen(h4Texts) & " h4 tags")>
<!--- System prompt for URL analysis --->
<cfset systemPrompt = "You are an expert at extracting structured menu data from restaurant website HTML. Extract ALL menu data visible in the HTML. Return valid JSON with these keys: business (object with name, address, phone, hours, brandColor), categories (array of category names), modifiers (array of modifier templates with name, required boolean, appliesTo, categoryName if applicable, and options array), items (array with name, description, price, category, subcategory, modifiers array, and imageUrl if found). CRITICAL: Extract EVERY menu item visible in the HTML - do not skip any items. For items: if there is a subsection header (like an h3) above the item within its category section, include that as subcategory. For brandColor: suggest a vibrant hex color (6 digits, no hash symbol) based on the restaurant style. For hours: format as ""Mon-Fri 10:30am-10pm, Sat 11am-10pm, Sun 11am-9pm"". Include ALL days visible. For prices: extract as numbers (e.g., 12.99). For modifier options: use format {""name"": ""option"", ""price"": 0}. Return ONLY valid JSON, no markdown, no explanation.">
<cfset systemPrompt = "You are an expert at extracting structured menu data from restaurant website HTML. Extract ALL menu data visible in the HTML. Return valid JSON with these keys: business (object with name, address, phone, hours, brandColor), categories (array of ONLY top-level category names), modifiers (array of modifier templates with name, required boolean, appliesTo, categoryName if applicable, and options array), items (array with name, description, price, category, subcategory, modifiers array, and imageUrl if found). CRITICAL: Extract EVERY menu item. CRITICAL for subcategories: In Toast POS menus, some categories contain subsections (like Beverages containing Beer, Wine, Cocktails). For items in subsections: set category to the PARENT (e.g. Beverages), set subcategory to the subsection name (e.g. Beer). Do NOT include subsection names in the categories array - only include top-level categories. For brandColor: suggest a vibrant hex color (6 digits, no hash symbol) based on the restaurant style. For hours: format as ""Mon-Fri 10:30am-10pm, Sat 11am-10pm, Sun 11am-9pm"". Include ALL days visible. For prices: extract as numbers (e.g., 12.99). For modifier options: use format {""name"": ""option"", ""price"": 0}. Return ONLY valid JSON, no markdown, no explanation.">
<!--- Build message content --->
<cfset messagesContent = arrayNew(1)>