Tool က Agent လက်ပါ။ နာမည်၊ လုပ်ဆောင်ချက်၊ input၊ output၊ အန္တရာယ်အဆင့်ကို ရှင်းမှ မှန်ကန်စွာ ခေါ်ပါတယ်။
ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်
Model က ကမ္ဘာကို တိုက်ရိုက်မမြင်ပါဘူး။ Tool description ကိုဖတ်ပြီး JSON-like argument ပို့ပါတယ်။ ကိုယ်က function ကို run ပြီး ရလဒ်ကို ပြန်ပေးပါတယ်။ Tool ကောင်းရင် နာမည်တိုတယ်၊ ဘာလုပ်တယ် ပြောတယ်၊ ဘာမလုပ်ဘူး ပြောတယ်၊ ဥပမာ argument ပါတယ်။ Tool မကောင်းရင် “doAnything(query)” လို ကျယ်ပြီး Agent က မှန်းသုံးပါတယ်။ ပထမဆုံး Agent မှာ tool ၁–၃ ခုသာ ပေးပါ။
နေ့စဉ်ဘဝနဲ့ ချိတ်ကြည့်မယ်
Study helper အတွက် စတင် tool သုံးခု — list_notes()၊ read_note(name)၊ draft_summary(text)။ list_notes က နာမည်ပဲပြန်တယ်။ read_note က စာသားပဲပြန်တယ်။ draft_summary က စာမသိမ်းဘူး၊ draft ပဲထုတ်တယ်။ save_note ကို နောက်မှ၊ လူ့ Approve နဲ့မှ ထည့်ပါ။ Tool တစ်ခုက ဘေးထွက်ဆိုးကျိုးနည်းလေ Agent က ပိုလုံခြုံလေပါ။
အတူတူ လက်တွေ့စမ်းမယ်
const tools = [
{
name: "list_notes",
description: "List note file names in the study folder. Read-only.",
input: {},
},
{
name: "read_note",
description: "Read one note by file name. Does not change files.",
input: { name: "string" },
},
{
name: "draft_summary",
description: "Draft a 3-bullet summary. Does not save anything.",
input: { text: "string" },
},
];Read-only tool သုံးခုကို ရှင်းလင်းသော description နဲ့ ရေးနိုင်မည်။၅ မိနစ် စမ်းကြည့်
ကိုယ့် Agent အတွက် tool ၃ ခုရေးပါ။ တစ်ခုချင်း name၊ description၊ input၊ read-only / write ဟုတ်မဟုတ် ဇယားဆွဲပါ။
သတိလေးတစ်ချက်
shell.run သို့မဟုတ် fetch(url) ကို ပထမဆုံး tool အဖြစ် မပေးပါနှင့်။ Agent က ကိုယ်မကြည့်သောနေရာကို ရောက်သွားနိုင်ပါတယ်။