Commit 7ccef44e authored by Hoanganhvu123's avatar Hoanganhvu123

feat(stylist): add strict reminder before LLM call

Inject English reminder message right before LLM call to force:
- All SKUs in response MUST be in product_ids
- Combo/set queries MUST return 5+ products
- Pick from suggest_items/ai_matches if tool returns <5
- Final self-check for (XXXXX) patterns
Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
parent 418eb57c
...@@ -592,6 +592,14 @@ class LeadStageGraph: ...@@ -592,6 +592,14 @@ class LeadStageGraph:
HumanMessage(content="=== KHÔNG CÓ TOOL RESULT === (Khách chào hỏi hoặc câu hỏi chung)") HumanMessage(content="=== KHÔNG CÓ TOOL RESULT === (Khách chào hỏi hoặc câu hỏi chung)")
) )
# Strict reminder before LLM call
stylist_messages.append(HumanMessage(content="""REMINDER - MUST FOLLOW:
1. List ALL SKUs mentioned in your response in `product_ids` array.
2. For combo/set queries: MUST return 5+ products (TOP + BOTTOM).
3. If tool returns <5 items, PICK MORE from `suggest_items`/`ai_matches`.
4. Final check: Scan your response for (XXXXX) patterns, ensure ALL are in `product_ids`.
Output ONLY JSON, no extra text!"""))
# ── LLM Call: Parse JSON from text (Claude returns text, not structured) ── # ── LLM Call: Parse JSON from text (Claude returns text, not structured) ──
# ── LLM Call: Parse JSON from text (Claude returns text, not structured) ── # ── LLM Call: Parse JSON from text (Claude returns text, not structured) ──
start = time.time() start = time.time()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment