Explicit subcategory rule: outer section = parent, inner sections = subcats
This commit is contained in:
parent
2163bb3009
commit
bed088d0ff
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 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.">
|
||||
<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), items (array with name, description, price, category, subcategory, modifiers array, and imageUrl if found). CRITICAL: Extract EVERY menu item. SUBCATEGORY RULE: If a section header (like h3) has NO menu items directly below it, but contains NESTED sections (each with their own h3 and items), then: the outer section is the PARENT CATEGORY, the inner sections are SUBCATEGORIES. For items in subcategories, set category to the PARENT name and subcategory to the inner section name. Example: outer h3 says 'Drinks', inner h3s say 'Beer' and 'Wine' with items under them - those items should have category='Drinks' and subcategory='Beer' or 'Wine'. For brandColor: suggest a vibrant hex (6 digits, no hash). For prices: numbers (e.g., 12.99). Return ONLY valid JSON.">
|
||||
|
||||
<!--- Build message content --->
|
||||
<cfset messagesContent = arrayNew(1)>
|
||||
|
|
|
|||
Reference in a new issue