Langfuse WorkshopClickHouse Workshops

04 การมอนิเตอร์

แนวทางผู้เรียน: 04 Monitoring

เอกสารเวิร์กชอปนี้รักษาไว้ในที่เก็บข้อมูลสาธารณะ langfuse/langfuse-workshop ใช้ที่เก็บข้อมูลสำหรับแอปที่รันได้ สาขา checkpoint และการตั้งค่าในเครื่อง

ดูไฟล์ Markdown นี้

แนวทางผู้เรียน: 04 Monitoring

หมายเหตุผู้สอน

  • นี่ยังเป็นบท UI-first แต่มันผสมสัญญาณสองประเภท: LLM-as-a-judge สำหรับสัญญาณ semantic และ code evaluator สำหรับสัญญาณหงุดหงิด deterministic
  • ปิดด้วยการ seeding: หลัง monitors เป็นสด npm run langfuse:seed:otel:no-scores หย่อน batch ของสมจริง production 交通 (incl. out-of-scope all-caps และ disagreement edge cases) ลงในโครงการ และเพราะ evaluators อยู่แล้วมีรายได้สด - a satisfying "watch the monitors ไฟขึ้น scale" payoff :no-scores variant is intentional — คะแนนควรมาจาก learner's own evaluators ไม่ใช่ seed ตรวจสอบผู้เรียนมันไม่ idempotent (re-running doubles the data)
  • ก่อน evaluator แรก ยืนยัน project มี Project Settings → LLM Connections กำหนดค่า On fresh projects Set up evaluator wizard blocks บน Set up LLM connection step จนกว่า default model จะบันทึก — ให้ผู้เรียนเลือก OpenAI connection และ structured-output-capable model ที่นั่น
  • managed templates อยู่ภายใต้ Use existing บน Set up evaluator page ผู้เรียนที่คลิก Create from scratch → LLM as a judge evaluator สิ้นสุด ใน blank Create new evaluator form และคิดว่า templates ไป — ให้พวกเขาปิด dialog และเลือกจากรายการ
  • อธิบายว่าทำไมสอง monitors เป้าหมาย different observations: out-of-scope ต้อง system prompt บน generation ในขณะที่ disagreement ต้องประวัติการสนทนาบน agent root
  • อธิบายว่าทำไม all-caps monitor is code-based: model call ไม่ต้อง เมื่อ simple deterministic rule เพียงพอ
  • ใช้ผลลัพธ์ evaluator แรกไม่กี่เป็น debugging exercise ไม่ใช่เพียง pass/fail check

จังหวะการสาธิต

  1. กำหนดค่า Out-of-Scope Request บน final generation observations
  2. กำหนดค่า User Disagreement บน dad-it-support-chat-turn agent observation
  3. กำหนดค่า all-caps code evaluator บน same dad-it-support-chat-turn agent observation
  4. ส่ง one clean in-scope turn one out-of-scope turn one disagreement turn และ one all-caps turn
  5. Seed production traffic ด้วย npm run langfuse:seed:otel:no-scores จากนั้น refresh Tracing view และดู live evaluators คะแนน seeded batch

ต้องระวัง

  • อาจเลือก wrong template สำหรับ User Disagreement โดยไม่ได้ตั้งใจ
  • ถือ Langfuse API keys จาก .env เพียงพอสำหรับ evaluators Judge-based evaluators ยังต้อง Langfuse-side LLM connection
  • การแม็พ last_user_message เข้า last transcript item บน final generation final generations รวม tool messages หลัง user turn
  • สำหรับ all-caps signal ชอบ Python version ในเอกสาร learner มากกว่า fighting TypeScript editor
  • ผู้เรียนสมมติว่า all-caps score คือการ guarantee ของ anger เฟรมเป็น triage signal ไม่ใช่ verdict

ในหน้านี้

TH