// File: components/ai/intent-classification/analytics/recalibration-panel.tsx // Change Log // - 2026-05-19: สร้าง Recalibration Panel สำหรับ Analytics Dashboard (T036, US3). 'use client'; import { AlertTriangle } from 'lucide-react'; import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@/components/ui/table'; import type { RecalibrationRecommendation } from '@/lib/services/ai-intent.service'; interface RecalibrationPanelProps { data: RecalibrationRecommendation[]; } /** * แสดงคำแนะนำ Intent ที่ควรเพิ่ม pattern เพื่อลด LLM Calls * ตาม SC-001: เป้าหมาย Pattern Hit Rate 70-80% */ export function RecalibrationPanel({ data }: RecalibrationPanelProps) { if (data.length === 0) { return ( ไม่มีคำแนะนำ ยังไม่มี Intent ที่ต้องเพิ่ม Pattern — Pattern Hit Rate อยู่ในระดับดี ); } return (
ควรเพิ่ม Pattern Intent ด้านล่างถูก classify ด้วย LLM บ่อย — การเพิ่ม keyword/regex pattern จะช่วยลดภาระ LLM และเพิ่มความเร็ว Intent Code LLM Calls Avg Confidence Priority {data.map((row) => ( {row.intentCode} {row.llmCallCount} {row.avgConfidence.toFixed(2)} {row.priority} ))}
); }