/*export const getOcrPrompt = () => `
ROLE: High-Precision OCR Engine for Whisky Labels.
OBJECTIVE: Extract visible metadata strictly from the image.
SPEED PRIORITY: Do NOT analyze flavor. Do NOT provide descriptions. Do NOT add tags.

TASK:
1. Identify if the image contains a whisky/spirit bottle.
2. Extract the following technical details into the JSON schema below.
3. If a value is not visible or cannot be inferred with high certainty, use null.

EXTRACTION RULES:
- Name: Combine Distillery + Age + Edition + Vintage (e.g., "Signatory Vintage Ben Nevis 2019 4 Year Old").
- Distillery: The producer of the spirit.
- Bottler: Independent bottler (e.g., "Signatory", "Gordon & MacPhail") if applicable.
- Batch Info: Capture ALL Cask numbers, Batch IDs, Bottle numbers, Cask Types (e.g., "Refill Oloroso Sherry Butt, Bottle 1135").
- Codes: Look for laser codes etched on glass/label (e.g., "L20394...").
- Dates: Distinguish clearly between Vintage (distilled year), Bottled year, and Age.

OUTPUT SCHEMA (Strict JSON):
{
  "name": "string",
  "distillery": "string",
  "bottler": "stringOrNull",
  "category": "string (e.g. Single Malt Scotch Whisky)",
  "abv": numberOrNull,
  "age": numberOrNull,
  "vintage": "stringOrNull",
  "distilled_at": "stringOrNull (Year/Date)",
  "bottled_at": "stringOrNull (Year/Date)",
  "batch_info": "stringOrNull",
  "bottleCode": "stringOrNull",
  "whiskybaseId": "stringOrNull",
  "is_whisky": boolean,
  "confidence": number
}
`;*/

export const getOcrPrompt = () => `
ROLE: Master Whisky Archivist & High-Precision OCR Specialist.

OBJECTIVE: You are processing a bottle image to catalog it into a high-end whisky database. accuracy regarding dates and batch codes is critical.

TASK:
1. TRANSCRIPTION PHASE (Mental Scratchpad):
   - Scan the label from Top to Bottom.
   - transcribe ALL text nodes found.
   - Pay special attention to SCRIPT/CURSIVE fonts often found near the "Age" statement (identifying Distilled/Bottled dates).
   - Pay special attention to MICRO-TEXT at the bottom (identifying bottle counts).

2. EXTRACTION PHASE:
   - Map the transcribed text to the JSON schema.
   - CALCULATE: If "Distilled" and "Bottled" years are visible, verify if extraction matches "Age".

IMAGE CONTEXT:
- Label: Cadenhead's Natural Strength.
- Look specifically for the text "Distilled [YEAR]" and "Bottled [MONTH/YEAR]".

OUTPUT SCHEMA (Strict JSON):
{
  "search_query": "string (A perfect search string to find this exact bottle on Google/Whiskybase, e.g. 'Annandale 2011 Cadenhead 10 year old Oloroso')",
  "name": "string (Clean name without volume/abv)",
  "distillery": "string",
  "bottler": "string",
  "series": "string (e.g. Natural Strength, Un-Chillfiltered)",
  "vintage": "string (Year of distillation)",
  "bottled": "string (Year/Month of bottling)",
  "calculated_age": number (If age is not stated, calculate Bottled - Vintage),
  "stated_age": number (Only if explicitly printed 'X Years'),
  "cask_type": "string (e.g. Oloroso Cask)",
  "batch_limit": "string (e.g. 348 bottles)",
  "abv": number,
  "volume": "string",
  "confidence": number,
  "confidence_scores": {
    "name": number,
    "distillery": number,
    "abv": number,
    "age": number,
    "cask_type": number
  }
}
`;



export const getEnrichmentPrompt = (name: string, distillery: string, availableTags: string, language: string) => `
TASK: You are a Whisky Sommelier.
INPUT: A whisky named "${name}" from distillery "${distillery}".

1. DATABASE LOOKUP:
Retrieve the sensory profile and specific Whiskybase search string for this bottling.
Use your expert knowledge.

2. TAGGING:
Select the top 5-8 flavor tags strictly from this list:
[${availableTags}]

3. SEARCH STRING:
Create a precise search string for Whiskybase using: "site:whiskybase.com [Distillery] [Vintage/Age] [Bottler/Edition]"

OUTPUT JSON:
{
  "suggested_tags": ["tag1", "tag2", "tag3"],
  "suggested_custom_tags": ["uniquer_note_if_missing_in_list"],
  "search_string": "string"
}
`;

// Legacy support (to avoid immediate breaking changes while refactoring)
export const getSystemPrompt = (availableTags: string, language: string) => `
${getOcrPrompt()}
Additionally, provide:
- suggested_tags: string[] (matched against [${availableTags}])
- suggested_custom_tags: string[]
- search_string: string
`;

export const getFlavorRadarPrompt = (nose: string, palate: string, finish: string, tags: string[]) => `
TASK: Analyze the following whisky tasting notes and tags to generate a flavor profile.
NOTES:
Nose: ${nose}
Palate: ${palate}
Finish: ${finish}
Tags: ${tags.join(', ')}

OBJECTIVE: Score the intensity (0-100) for the following 5 dimensions. 
Be objective. If a category is not mentioned or implied, score it low (0-10).
1. Smoky (Rauchig, Torf, Peat, Ash, Smoke, Lagerfeuer, Teer)
2. Fruity (Fruchtig, Berry, Citrus, Apple, Sherry-Fruits, Peach, Tropical)
3. Spicy (Würzig, Pepper, Oak, Cinnamon, Clove, Ginger, Nutmeg)
4. Sweet (Süß, Caramel, Vanille, Honey, Chocolate, Toffee, Sugar)
5. Floral (Floral, Heather, Grass, Flowers, Rose, Lavender, Herbs)

OUTPUT JSON:
{
  "smoky": number,
  "fruity": number,
  "spicy": number,
  "sweet": number,
  "floral": number
}
`;
