Chain-of-thought เพื่อค้นหากระบวนการให้เหตุผล
โจทย์คณิตศาสตร์ทั่วไปข้อหนึ่งถูกนำมาให้แก้ โดยต้องหาจำนวนผลไม้ในตะกร้า คุณต้องการให้ ChatGPT แก้โจทย์นี้พร้อมอธิบายเหตุผลทีละขั้นตอน
ฟังก์ชัน get_response() สำหรับสื่อสารกับ ChatGPT ถูกโหลดไว้ให้แล้ว
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Explainable AI ด้วย Python
คำแนะนำการฝึกหัด
- เติม
promptให้สมบูรณ์เพื่อให้ได้การให้เหตุผลแบบ chain-of-thought สำหรับโจทย์นี้
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Complete the chain-of-thought prompt
prompt = "In a basket, there are twice as many apples as oranges and three times as many oranges as bananas. If there are 6 bananas in the basket, how many fruits are there in total? ____"
response = get_response(prompt)
print(response)