บทบาทในการสนทนาสำหรับฝ่ายสนับสนุนลูกค้า
BrightCart's live-chat traffic has doubled since launching the new interface. You're training a support bot to handle simple FAQs instantly but escalate anything that needs account access or deep tech fixes. For example, the bot can handle questions such as password resets and shipping ETAs, but billing errors or app crashes must be handed off to a human agent.
Give Claude a few example turns that lock in this behavior so customers always get quick help from the bot, or a smooth transfer to specialists.
The anthropic library, client, and customer_question variable are pre-loaded.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Claude Models เบื้องต้น
คำแนะนำการฝึกหัด
- กำหนด role สำหรับการตอบกลับของ assistant ในคำถามเกี่ยวกับรหัสผ่าน
- เขียนการตอบกลับแบบยกระดับที่แนะนำให้ลูกค้าติดต่อฝ่ายสนับสนุนที่เป็นมนุษย์สำหรับปัญหาการเรียกเก็บเงิน
- เพิ่มคำถามของลูกค้าโดยใช้ role แบบ user
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
messages = [
{"role": "user", "content": "How do I reset my password?"},
# Show how the bot handles simple questions
{"role": ____, "content": "Click 'Forgot Password' on the login page, enter your email, and check for our reset link."},
{"role": "user", "content": "Why is my account being charged twice?"},
# Demonstrate escalation for billing issues
{"role": "assistant", "content": ____},
# Add the new customer question for the bot to handle
{"role": ____, "content": customer_question}]
response = client.messages.create(
model="claude-sonnet-4-6", max_tokens=75,
messages=messages)
print(response.content[0].text)