ข้อความเกรดวัสดุใน prompt: ใช้ "แคตตาล็อก 2026 ระบุ" แทน "ผลิตจริง" · ตัวตรวจตัด \ ของ markdown
Browse filesfix8_r1 (gemini-3.8-flash) AP-002/006/007 ยังพูดว่า "เกรดวัสดุที่ผลิตจริง" เพราะ note_th
ใน application_match เขียน "และผลิตจริง" — commit material-wording แก้แค่ material_gate
ข้อมูลมีแค่ว่าแคตตาล็อกระบุ (not_listed · unresolved) จึงแก้อีกสองจุดที่ LLM เห็นด้วย:
- brands/modutech/turn.py note_th + กฎ grade_match ใน system prompt
- brands/modutech/router.py belt_grade_note_th ("ผลิตเฉพาะ" → "ในแคตตาล็อก 2026 ระบุเฉพาะ")
shadow copy beltbot_plugin/ · beltbot_plugin_overlay/ ไม่ได้แก้ (บอตไม่ import)
run_answer_eval.py norm_text: ตัด \ หน้า * _ ~ ` ก่อนเทียบ
graph_fix8 SPK-F03 รหัสถูกแต่เขียน MD-TR254SQZ10\*POM → ตก · ตรวจซ้ำไฟล์เดิม:
graph_fix8 32→33 · graph_run1 32→33 (SPK-F06 สาเหตุเดียวกัน) · graph_run2 · fix7_r1 · fix6_r2 · fix8_r1 ไม่เปลี่ยน
ไม่ใช้ LLM (python 3.13 ใน workspace): testsuite_120 150/150 · test_context_voice 15/15 ·
test_sprocket_flow 45/45 · testcases_graph 33 · test_modutech_kg 36/36 · test_modutech_kg_apps 19/19 ·
test_resume 22/22 · test_core_* ผ่าน · test_llm_thinking 14/14 · CSV ที่สร้างตรงเดิม (ต่างแค่ปลายบรรทัด)
ยังไม่ได้รัน: prompt snapshot · test_api_resume · test_assistant_resume (ต้องมี torch/fastapi/qdrant)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GoJrXN2NjFZFia5pEPo7bu
- brands/modutech/router.py +1 -1
- brands/modutech/turn.py +3 -2
- run_answer_eval.py +3 -0
|
@@ -456,7 +456,7 @@ class ApplicationMatch:
|
|
| 456 |
|
| 457 |
def belt_grade_note_th(recommended: str, made: list[str], registry: dict) -> str:
|
| 458 |
grades = ", ".join(made)
|
| 459 |
-
note = (f"หน้างานในเล่มแนะนำเกรด {recommended} แต่ตารางสเปกของรุ่นนี้
|
| 460 |
f"({recommended} เป็นชื่อตระกูล {grades} เป็นชนิดย่อย) ให้ระบุเกรด {grades} เสมอ")
|
| 461 |
wet = {(registry.get(m) or {}).get("temperature", {}).get("wet") for m in made}
|
| 462 |
if "not recommended" in wet:
|
|
|
|
| 456 |
|
| 457 |
def belt_grade_note_th(recommended: str, made: list[str], registry: dict) -> str:
|
| 458 |
grades = ", ".join(made)
|
| 459 |
+
note = (f"หน้างานในเล่มแนะนำเกรด {recommended} แต่ตารางสเปกของรุ่นนี้ในแคตตาล็อก 2026 ระบุเฉพาะ {grades} "
|
| 460 |
f"({recommended} เป็นชื่อตระกูล {grades} เป็นชนิดย่อย) ให้ระบุเกรด {grades} เสมอ")
|
| 461 |
wet = {(registry.get(m) or {}).get("temperature", {}).get("wet") for m in made}
|
| 462 |
if "not recommended" in wet:
|
|
@@ -189,7 +189,8 @@ def build_modutech_turn(decision: Decision, cat: Catalogue, search: CatalogueSea
|
|
| 189 |
**({"grade_notes_th": am.grade_notes_th} if am.grade_notes_th else {}),
|
| 190 |
"note_th": (f"รายชื่อนี้ครบทุกรุ่น ({len(am.belt_codes)} รุ่น) ที่แคตตาล็อกระบุว่าใช้กับงานนี้"
|
| 191 |
+ (f" ในอุตสาหกรรม {am.industry}" if am.industry_filter_applied else "")
|
| 192 |
-
+ "
|
|
|
|
| 193 |
+ (f" (รายละเอียดเต็มแนบมา {MAX_FULL_RECORDS} รุ่นแรก)" if len(am.belt_codes) > MAX_FULL_RECORDS else "")),
|
| 194 |
}
|
| 195 |
debug.append(f"application: {am.applications} → {len(am.belt_codes)} รุ่น")
|
|
@@ -341,7 +342,7 @@ def _system_prompt(context: dict, rules: dict[str, list[str]]) -> str:
|
|
| 341 |
ห้ามบอกว่าแคตตาล็อกไม่มีข้อมูลเรื่องนั้น เพราะ Context เป็นเพียงบางส่วนของแคตตาล็อก
|
| 342 |
- ถ้ามี industry_match ให้บอกลูกค้าก่อนว่าแคตตาล็อกไม่มีงานนี้โดยตรง แล้วตอบจากรายชื่อของอุตสาหกรรมนั้น
|
| 343 |
พร้อมงานใช้และเกรดที่เล่มระบุ (applications_by_belt) ถ้ามี grade_match ให้บอกรุ่นใน grade_match.belts พร้อมเกรดนั้นก่อน
|
| 344 |
-
รุ่นอื่นไม่ได้
|
| 345 |
ถ้า grade_match.belts ว่าง ให้บอกตาม note_th ห้ามสรุปเองว่ารุ่นใดเหมาะกับงานที่ถามเกินกว่าที่เล่มระบุ
|
| 346 |
ตอบกระชับ: รุ่นที่เกี่ยวข้องที่สุดไม่เกิน 5 รุ่นพร้อมงานใช้ ที่เหลือบอกเป็นรายชื่อบรรทัดเดียว
|
| 347 |
- ถ้ามี application_match หรือ industry_match และลูกค้าไม่ได้ถามเรื่องอุณหภูมิ ไม่ต้องถามกลับเรื่องไลน์เปียกหรือแห้ง
|
|
|
|
| 189 |
**({"grade_notes_th": am.grade_notes_th} if am.grade_notes_th else {}),
|
| 190 |
"note_th": (f"รายชื่อนี้ครบทุกรุ่น ({len(am.belt_codes)} รุ่น) ที่แคตตาล็อกระบุว่าใช้กับงานนี้"
|
| 191 |
+ (f" ในอุตสาหกรรม {am.industry}" if am.industry_filter_applied else "")
|
| 192 |
+
+ " เกรดวัสดุของแต่ละรุ่นคือเกรดที่แคตตาล็อก 2026 ระบุ"
|
| 193 |
+
+ " ถ้าลูกค้าถามว่ามีรุ่นไหนบ้าง ให้ตอบครบทุกรุ่นพร้อมเกรดวัสดุ"
|
| 194 |
+ (f" (รายละเอียดเต็มแนบมา {MAX_FULL_RECORDS} รุ่นแรก)" if len(am.belt_codes) > MAX_FULL_RECORDS else "")),
|
| 195 |
}
|
| 196 |
debug.append(f"application: {am.applications} → {len(am.belt_codes)} รุ่น")
|
|
|
|
| 342 |
ห้ามบอกว่าแคตตาล็อกไม่มีข้อมูลเรื่องนั้น เพราะ Context เป็นเพียงบางส่วนของแคตตาล็อก
|
| 343 |
- ถ้ามี industry_match ให้บอกลูกค้าก่อนว่าแคตตาล็อกไม่มีงานนี้โดยตรง แล้วตอบจากรายชื่อของอุตสาหกรรมนั้น
|
| 344 |
พร้อมงานใช้และเกรดที่เล่มระบุ (applications_by_belt) ถ้ามี grade_match ให้บอกรุ่นใน grade_match.belts พร้อมเกรดนั้นก่อน
|
| 345 |
+
รุ่นอื่นแคตตาล็อก 2026 ไม่ได้ระบุเกรดนั้น ห้ามจัดรุ่นอื่นไว้ใต้หัวข้อหรือประโยคที่พูดถึงเกรดนั้น ให้แยกเป็นหัวข้อรุ่นอื่นในอุตสาหกรรมเดียวกัน
|
| 346 |
ถ้า grade_match.belts ว่าง ให้บอกตาม note_th ห้ามสรุปเองว่ารุ่นใดเหมาะกับงานที่ถามเกินกว่าที่เล่มระบุ
|
| 347 |
ตอบกระชับ: รุ่นที่เกี่ยวข้องที่สุดไม่เกิน 5 รุ่นพร้อมงานใช้ ที่เหลือบอกเป็นรายชื่อบรรทัดเดียว
|
| 348 |
- ถ้ามี application_match หรือ industry_match และลูกค้าไม่ได้ถามเรื่องอุณหภูมิ ไม่ต้องถามกลับเรื่องไลน์เปียกหรือแห้ง
|
|
@@ -123,6 +123,9 @@ def split_tokens(raw: str) -> list[str]:
|
|
| 123 |
def norm_text(text: str) -> str:
|
| 124 |
"""ตัดตัวคั่นหลักพันและช่องว่างซ้ำ เพื่อให้ 1,000 กับ 1000 เทียบกันได้"""
|
| 125 |
text = (text or "").lower()
|
|
|
|
|
|
|
|
|
|
| 126 |
text = re.sub(r"(?<=\d),(?=\d{3}\b)", "", text)
|
| 127 |
return re.sub(r"\s+", " ", text)
|
| 128 |
|
|
|
|
| 123 |
def norm_text(text: str) -> str:
|
| 124 |
"""ตัดตัวคั่นหลักพันและช่องว่างซ้ำ เพื่อให้ 1,000 กับ 1000 เทียบกันได้"""
|
| 125 |
text = (text or "").lower()
|
| 126 |
+
# 23 ต.ค. (graph_fix8 SPK-F03): gemini-3.8-flash เขียนรหัสสเตอร์นอก backtick เป็น MD-TR254SQZ10\*POM
|
| 127 |
+
# (escape ของ markdown — หน้าเว็บแสดงเป็น *) ตัด \ หน้าอักขระ markdown ก่อนเทียบ ไม่งั้นรหัสถูกแต่ตรวจไม่เจอ
|
| 128 |
+
text = re.sub(r"\\([*_~`])", r"\1", text)
|
| 129 |
text = re.sub(r"(?<=\d),(?=\d{3}\b)", "", text)
|
| 130 |
return re.sub(r"\s+", " ", text)
|
| 131 |
|