<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data noupdate="1">
        <record id="llm_prompt_affiliate_palette" model="llm.prompt">
            <field name="x_name">[Agent Prompt] Affiliate Palette Extractor</field>
            <field name="x_prompt_description">Identifies the brand colour palette of an affiliate's website from a homepage screenshot.</field>
            <field name="x_llm_provider_id" ref="llm_base.llm_provider_huble"/>
            <field name="x_llm_model" search="[('x_model', '=', 'qwen2.5-vl-72b-instruct'), ('x_llm_provider_id', '=', ref('llm_base.llm_provider_huble'))]"/>
            <field name="x_llm_temperature">0.2</field>
            <field name="x_system_prompt"><![CDATA[You are a brand-design analyst. Given a screenshot of a company's homepage, identify its full brand colour palette and return it as JSON.

Output exactly eleven colour roles, each a 6-digit lowercase hex string starting with `#`:
- "primary": the brand colour used on logos, headers, primary buttons, and accent strips.
- "on_primary": the text colour that sits on primary surfaces (usually white or a very pale tint).
- "background": the dominant page background colour (usually white or a very pale tint).
- "surface": elevated card / panel background (slightly off-white or a faint brand tint; fall back to background if the design uses flat surfaces).
- "heading": the colour of headlines and titles (often dark, sometimes the brand colour).
- "text": the colour of body text (typically a dark grey or near-black).
- "border": subtle borders and dividers (usually a light grey or a desaturated brand tint).
- "navbar_bg": the top navigation bar background.
- "navbar_text": the text colour on the navigation bar.
- "footer_bg": the footer background.
- "footer_text": the text colour on the footer.

Hard rules:
- Always return all eleven hex codes. Never omit a slot.
- Pick brand colours that appear in the actual rendered design, not imagined ones.
- Do not pick colours from photographs / hero images unless the brand clearly uses them as identity colours.
- If a role is unclear, derive it from the closest related role (e.g. on_primary defaults to white when primary is dark, dark when primary is light; border defaults to a light grey).]]></field>
            <field name="x_user_prompt"><![CDATA[Extract the full brand colour palette from this homepage screenshot of {record.partner_id.name}'s website ({record.affiliate_website}). Return the 11-slot JSON only.]]></field>
            <field name="x_output_format_rule"><![CDATA[
{
    "primary":     "#rrggbb",
    "on_primary":  "#rrggbb",
    "background":  "#rrggbb",
    "surface":     "#rrggbb",
    "heading":     "#rrggbb",
    "text":        "#rrggbb",
    "border":      "#rrggbb",
    "navbar_bg":   "#rrggbb",
    "navbar_text": "#rrggbb",
    "footer_bg":   "#rrggbb",
    "footer_text": "#rrggbb"
}
            ]]></field>
        </record>

        <record id="llm_agent_affiliate_palette" model="llm.agent">
            <field name="x_name">[Agent] Affiliate Palette Extractor</field>
            <field name="x_description">Captures a screenshot of the affiliate's website and asks a vision-capable LLM to identify its 5-slot brand palette. Output is written to the affiliate.widget.config theme_* fields.</field>
            <field name="x_agent_type">extract</field>
            <field name="x_model_id" ref="kj_affiliate_widget.model_affiliate_widget_config"/>
            <field name="x_llm_prompt_id" ref="llm_prompt_affiliate_palette"/>
            <field name="x_llm_prompt_ids" eval="[(4, ref('llm_prompt_affiliate_palette'))]"/>
            <field name="x_batch_size">1</field>
            <field name="x_active" eval="True"/>
            <field name="x_notify_on_completion" eval="False"/>
        </record>
    </data>
</odoo>
