File size: 15,147 Bytes
b0b814f
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
{"messages": [{"role": "system", "content": "You are a helpful assistant. เรียกใช้ tools เมื่อจำเป็นเท่านั้น ถ้าตอบได้เองหรือไม่มี tool รองรับ อย่าเรียก tool\n<tools>\n[{\"name\": \"get_weather\", \"description\": \"ดูสภาพอากาศปัจจุบันของเมือง\", \"parameters\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}, \"unit\": {\"type\": \"string\", \"enum\": [\"c\", \"f\"]}}, \"required\": [\"city\"]}}, {\"name\": \"convert_currency\", \"description\": \"แปลงสกุลเงินตามเรตปัจจุบัน\", \"parameters\": {\"type\": \"object\", \"properties\": {\"amount\": {\"type\": \"number\"}, \"frm\": {\"type\": \"string\"}, \"to\": {\"type\": \"string\"}}, \"required\": [\"amount\", \"frm\", \"to\"]}}, {\"name\": \"search_db\", \"description\": \"ค้นข้อมูลลูกค้าจากชื่อหรืออีเมล\", \"parameters\": {\"type\": \"object\", \"properties\": {\"keyword\": {\"type\": \"string\"}, \"limit\": {\"type\": \"integer\"}}, \"required\": [\"keyword\"]}}]\n</tools>"}, {"role": "user", "content": [{"type": "text", "text": "อากาศกรุงเทพตอนนี้เป็นไง"}]}, {"role": "assistant", "content": [{"type": "text", "text": "ขอเช็กให้นะครับ"}, {"type": "tool_use", "id": "toolu_001", "name": "get_weather", "input": {"city": "Bangkok", "unit": "c"}}]}, {"role": "user", "content": [{"type": "tool_result", "tool_use_id": "toolu_001", "content": "{\"temp\":34,\"desc\":\"แดดจัด\"}"}]}, {"role": "assistant", "content": [{"type": "text", "text": "กรุงเทพ 34°C แดดจัด พกร่มกับน้ำด้วยครับ"}]}]}
{"messages": [{"role": "system", "content": "You are a helpful assistant. เรียกใช้ tools เมื่อจำเป็นเท่านั้น ถ้าตอบได้เองหรือไม่มี tool รองรับ อย่าเรียก tool\n<tools>\n[{\"name\": \"get_weather\", \"description\": \"ดูสภาพอากาศปัจจุบันของเมือง\", \"parameters\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}, \"unit\": {\"type\": \"string\", \"enum\": [\"c\", \"f\"]}}, \"required\": [\"city\"]}}, {\"name\": \"convert_currency\", \"description\": \"แปลงสกุลเงินตามเรตปัจจุบัน\", \"parameters\": {\"type\": \"object\", \"properties\": {\"amount\": {\"type\": \"number\"}, \"frm\": {\"type\": \"string\"}, \"to\": {\"type\": \"string\"}}, \"required\": [\"amount\", \"frm\", \"to\"]}}, {\"name\": \"search_db\", \"description\": \"ค้นข้อมูลลูกค้าจากชื่อหรืออีเมล\", \"parameters\": {\"type\": \"object\", \"properties\": {\"keyword\": {\"type\": \"string\"}, \"limit\": {\"type\": \"integer\"}}, \"required\": [\"keyword\"]}}]\n</tools>"}, {"role": "user", "content": [{"type": "text", "text": "เทียบอากาศเชียงใหม่กับภูเก็ต"}]}, {"role": "assistant", "content": [{"type": "text", "text": "เช็กพร้อมกันครับ"}, {"type": "tool_use", "id": "toolu_002", "name": "get_weather", "input": {"city": "Chiang Mai", "unit": "c"}}, {"type": "tool_use", "id": "toolu_003", "name": "get_weather", "input": {"city": "Phuket", "unit": "c"}}]}, {"role": "user", "content": [{"type": "tool_result", "tool_use_id": "toolu_002", "content": "{\"temp\":28}"}, {"type": "tool_result", "tool_use_id": "toolu_003", "content": "{\"temp\":31}"}]}, {"role": "assistant", "content": [{"type": "text", "text": "เชียงใหม่ 28°C เย็นกว่า ภูเก็ต 31°C"}]}]}
{"messages": [{"role": "system", "content": "You are a helpful assistant. เรียกใช้ tools เมื่อจำเป็นเท่านั้น ถ้าตอบได้เองหรือไม่มี tool รองรับ อย่าเรียก tool\n<tools>\n[{\"name\": \"get_weather\", \"description\": \"ดูสภาพอากาศปัจจุบันของเมือง\", \"parameters\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}, \"unit\": {\"type\": \"string\", \"enum\": [\"c\", \"f\"]}}, \"required\": [\"city\"]}}, {\"name\": \"convert_currency\", \"description\": \"แปลงสกุลเงินตามเรตปัจจุบัน\", \"parameters\": {\"type\": \"object\", \"properties\": {\"amount\": {\"type\": \"number\"}, \"frm\": {\"type\": \"string\"}, \"to\": {\"type\": \"string\"}}, \"required\": [\"amount\", \"frm\", \"to\"]}}, {\"name\": \"search_db\", \"description\": \"ค้นข้อมูลลูกค้าจากชื่อหรืออีเมล\", \"parameters\": {\"type\": \"object\", \"properties\": {\"keyword\": {\"type\": \"string\"}, \"limit\": {\"type\": \"integer\"}}, \"required\": [\"keyword\"]}}]\n</tools>"}, {"role": "user", "content": [{"type": "text", "text": "ลูกค้า somchai จ่าย 500 USD กี่บาท"}]}, {"role": "assistant", "content": [{"type": "text", "text": "หาข้อมูลก่อน"}, {"type": "tool_use", "id": "toolu_004", "name": "search_db", "input": {"keyword": "somchai", "limit": 1}}]}, {"role": "user", "content": [{"type": "tool_result", "tool_use_id": "toolu_004", "content": "{\"name\":\"Somchai P.\"}"}]}, {"role": "assistant", "content": [{"type": "text", "text": "แปลงเงินครับ"}, {"type": "tool_use", "id": "toolu_005", "name": "convert_currency", "input": {"amount": 500, "frm": "USD", "to": "THB"}}]}, {"role": "user", "content": [{"type": "tool_result", "tool_use_id": "toolu_005", "content": "{\"result\":18250.0}"}]}, {"role": "assistant", "content": [{"type": "text", "text": "Somchai P. จ่าย ≈ 18,250 บาท"}]}]}
{"messages": [{"role": "system", "content": "You are a helpful assistant. เรียกใช้ tools เมื่อจำเป็นเท่านั้น ถ้าตอบได้เองหรือไม่มี tool รองรับ อย่าเรียก tool\n<tools>\n[{\"name\": \"get_weather\", \"description\": \"ดูสภาพอากาศปัจจุบันของเมือง\", \"parameters\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}, \"unit\": {\"type\": \"string\", \"enum\": [\"c\", \"f\"]}}, \"required\": [\"city\"]}}, {\"name\": \"convert_currency\", \"description\": \"แปลงสกุลเงินตามเรตปัจจุบัน\", \"parameters\": {\"type\": \"object\", \"properties\": {\"amount\": {\"type\": \"number\"}, \"frm\": {\"type\": \"string\"}, \"to\": {\"type\": \"string\"}}, \"required\": [\"amount\", \"frm\", \"to\"]}}, {\"name\": \"search_db\", \"description\": \"ค้นข้อมูลลูกค้าจากชื่อหรืออีเมล\", \"parameters\": {\"type\": \"object\", \"properties\": {\"keyword\": {\"type\": \"string\"}, \"limit\": {\"type\": \"integer\"}}, \"required\": [\"keyword\"]}}]\n</tools>"}, {"role": "user", "content": [{"type": "text", "text": "function calling คืออะไร"}]}, {"role": "assistant", "content": [{"type": "text", "text": "คือความสามารถที่โมเดลเลือกเรียกฟังก์ชันภายนอกเองโดยสร้างชื่อ+พารามิเตอร์ที่ถูกต้อง แล้วระบบจริงรันให้"}]}]}
{"messages": [{"role": "system", "content": "You are a helpful assistant. เรียกใช้ tools เมื่อจำเป็นเท่านั้น ถ้าตอบได้เองหรือไม่มี tool รองรับ อย่าเรียก tool\n<tools>\n[{\"name\": \"get_weather\", \"description\": \"ดูสภาพอากาศปัจจุบันของเมือง\", \"parameters\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}, \"unit\": {\"type\": \"string\", \"enum\": [\"c\", \"f\"]}}, \"required\": [\"city\"]}}, {\"name\": \"convert_currency\", \"description\": \"แปลงสกุลเงินตามเรตปัจจุบัน\", \"parameters\": {\"type\": \"object\", \"properties\": {\"amount\": {\"type\": \"number\"}, \"frm\": {\"type\": \"string\"}, \"to\": {\"type\": \"string\"}}, \"required\": [\"amount\", \"frm\", \"to\"]}}, {\"name\": \"search_db\", \"description\": \"ค้นข้อมูลลูกค้าจากชื่อหรืออีเมล\", \"parameters\": {\"type\": \"object\", \"properties\": {\"keyword\": {\"type\": \"string\"}, \"limit\": {\"type\": \"integer\"}}, \"required\": [\"keyword\"]}}]\n</tools>"}, {"role": "user", "content": [{"type": "text", "text": "แปลงเงินให้หน่อย"}]}, {"role": "assistant", "content": [{"type": "text", "text": "ขอทราบจำนวน สกุลต้นทาง และสกุลปลายทางด้วยครับ"}]}]}
{"messages": [{"role": "system", "content": "You are a helpful assistant. เรียกใช้ tools เมื่อจำเป็นเท่านั้น ถ้าตอบได้เองหรือไม่มี tool รองรับ อย่าเรียก tool\n<tools>\n[{\"name\": \"get_weather\", \"description\": \"ดูสภาพอากาศปัจจุบันของเมือง\", \"parameters\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}, \"unit\": {\"type\": \"string\", \"enum\": [\"c\", \"f\"]}}, \"required\": [\"city\"]}}, {\"name\": \"convert_currency\", \"description\": \"แปลงสกุลเงินตามเรตปัจจุบัน\", \"parameters\": {\"type\": \"object\", \"properties\": {\"amount\": {\"type\": \"number\"}, \"frm\": {\"type\": \"string\"}, \"to\": {\"type\": \"string\"}}, \"required\": [\"amount\", \"frm\", \"to\"]}}, {\"name\": \"search_db\", \"description\": \"ค้นข้อมูลลูกค้าจากชื่อหรืออีเมล\", \"parameters\": {\"type\": \"object\", \"properties\": {\"keyword\": {\"type\": \"string\"}, \"limit\": {\"type\": \"integer\"}}, \"required\": [\"keyword\"]}}]\n</tools>"}, {"role": "user", "content": [{"type": "text", "text": "ดูอากาศเมือง Xyzland"}]}, {"role": "assistant", "content": [{"type": "text", "text": "เช็กให้ครับ"}, {"type": "tool_use", "id": "toolu_007", "name": "get_weather", "input": {"city": "Xyzland", "unit": "c"}}]}, {"role": "user", "content": [{"type": "tool_result", "tool_use_id": "toolu_007", "content": "{\"error\":\"city_not_found\"}"}]}, {"role": "assistant", "content": [{"type": "text", "text": "ไม่พบเมือง \"Xyzland\" ช่วยตรวจการสะกดครับ"}]}]}
{"messages": [{"role": "system", "content": "You are a helpful assistant. เรียกใช้ tools เมื่อจำเป็นเท่านั้น ถ้าตอบได้เองหรือไม่มี tool รองรับ อย่าเรียก tool\n<tools>\n[{\"name\": \"get_weather\", \"description\": \"ดูสภาพอากาศปัจจุบันของเมือง\", \"parameters\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}, \"unit\": {\"type\": \"string\", \"enum\": [\"c\", \"f\"]}}, \"required\": [\"city\"]}}, {\"name\": \"convert_currency\", \"description\": \"แปลงสกุลเงินตามเรตปัจจุบัน\", \"parameters\": {\"type\": \"object\", \"properties\": {\"amount\": {\"type\": \"number\"}, \"frm\": {\"type\": \"string\"}, \"to\": {\"type\": \"string\"}}, \"required\": [\"amount\", \"frm\", \"to\"]}}, {\"name\": \"search_db\", \"description\": \"ค้นข้อมูลลูกค้าจากชื่อหรืออีเมล\", \"parameters\": {\"type\": \"object\", \"properties\": {\"keyword\": {\"type\": \"string\"}, \"limit\": {\"type\": \"integer\"}}, \"required\": [\"keyword\"]}}]\n</tools>"}, {"role": "user", "content": [{"type": "text", "text": "ช่วยส่งอีเมลหาลูกค้า"}]}, {"role": "assistant", "content": [{"type": "text", "text": "ยังไม่มีเครื่องมือส่งอีเมลครับ ทำได้แค่ค้นลูกค้า ดูอากาศ แปลงเงิน"}]}]}
{"messages": [{"role": "system", "content": "You are a helpful assistant. เรียกใช้ tools เมื่อจำเป็นเท่านั้น ถ้าตอบได้เองหรือไม่มี tool รองรับ อย่าเรียก tool\n<tools>\n[{\"name\": \"get_weather\", \"description\": \"ดูสภาพอากาศปัจจุบันของเมือง\", \"parameters\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}, \"unit\": {\"type\": \"string\", \"enum\": [\"c\", \"f\"]}}, \"required\": [\"city\"]}}, {\"name\": \"convert_currency\", \"description\": \"แปลงสกุลเงินตามเรตปัจจุบัน\", \"parameters\": {\"type\": \"object\", \"properties\": {\"amount\": {\"type\": \"number\"}, \"frm\": {\"type\": \"string\"}, \"to\": {\"type\": \"string\"}}, \"required\": [\"amount\", \"frm\", \"to\"]}}, {\"name\": \"search_db\", \"description\": \"ค้นข้อมูลลูกค้าจากชื่อหรืออีเมล\", \"parameters\": {\"type\": \"object\", \"properties\": {\"keyword\": {\"type\": \"string\"}, \"limit\": {\"type\": \"integer\"}}, \"required\": [\"keyword\"]}}]\n</tools>"}, {"role": "user", "content": [{"type": "text", "text": "หาลูกค้า anan"}]}, {"role": "assistant", "content": [{"type": "text", "text": "ค้นให้ครับ"}, {"type": "tool_use", "id": "toolu_006", "name": "search_db", "input": {"keyword": "anan", "limit": 5}}]}, {"role": "user", "content": [{"type": "tool_result", "tool_use_id": "toolu_006", "content": "{\"rows\":[{\"name\":\"Anan K.\"},{\"name\":\"Anan S.\"}]}"}]}, {"role": "assistant", "content": [{"type": "text", "text": "เจอ 2 คน ต้องการคนไหนครับ"}]}, {"role": "user", "content": [{"type": "text", "text": "คนแรก ขออากาศเมืองเขา"}]}, {"role": "assistant", "content": [{"type": "text", "text": "ยังไม่มีข้อมูลเมืองของ Anan K. ครับ ช่วยบอกชื่อเมือง"}]}]}