Explicit subcategory detection with HTML structure example
This commit is contained in:
parent
99c2a6aa10
commit
2163bb3009
1 changed files with 1 additions and 1 deletions
|
|
@ -275,7 +275,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 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.">
|
||||
<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. SUBCATEGORY DETECTION: Look at the HTML structure. If a menuSection or menuGroup contains nested subsections with their own headers, those are subcategories. Example: if you see a section 'Drinks' containing subsections 'Beer' and 'Wine', and item 'Budweiser' is under 'Beer', output that item as: category='Drinks', subcategory='Beer'. Look for nested section/div structures where a parent contains multiple child sections each with items. For brandColor: suggest a vibrant hex color (6 digits, no hash symbol). For hours: format as ""Mon-Fri 10:30am-10pm, Sat 11am-10pm, Sun 11am-9pm"". 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)>
|
||||
|
|
|
|||
Reference in a new issue