Function calling ဖြင့် model ကို tool ရွေးခွင့်ပေးပြီး application က action ကို လုံခြုံစွာ execute လုပ်ပုံ လေ့လာမည်။
ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်
Model ကို database password ပေးပြီး တိုက်ရိုက်လုပ်ခိုင်းတာမဟုတ်ပါဘူး။ Developer က tool name၊ description နဲ့ JSON schema သတ်မှတ်ပေးပြီး model က tool call တင်ပြပါတယ်။ Application က arguments ကို validate၊ permission စစ်ပြီးမှ function ကို execute လုပ်ပါတယ်။

နေ့စဉ်ဘဝနဲ့ ချိတ်ကြည့်မယ်
Tool တစ်ခုကို တာဝန်တစ်ခုတည်းထားပြီး parameters ကိုတိကျစေပါ။ “manage_everything” လို tool ကြီးမလုပ်ပါနှင့်။ Read tool နဲ့ write tool ခွဲပြီး write action မှာ confirmation သို့မဟုတ် idempotency key သုံးပါ။
အတူတူ လက်တွေ့စမ်းမယ်
const tools = [{
type: "function",
name: "get_weather",
description: "မြို့တစ်မြို့၏ လက်ရှိမိုးလေဝသကို ရယူရန်",
parameters: {
type: "object",
properties: { city: { type: "string" } },
required: ["city"],
additionalProperties: false,
},
strict: true,
}];Schema တိကျတဲ့ read-only agent tool တစ်ခု သတ်မှတ်နိုင်မည်။၅ မိနစ် စမ်းကြည့်
Course search tool တစ်ခုနဲ့ enrollment write tool တစ်ခုရေးပါ။ Enrollment မလုပ်မီ user confirmation လိုကြောင်း rule ထည့်ပါ။
သတိလေးတစ်ချက်
AI output ကို အပြီးသတ်အမှန်လို့မယူပါနှင့်။ အရေးကြီးတဲ့အချက်၊ code နဲ့ user data ကို လူကပြန်စစ်ပြီးမှ အသုံးပြုပါ။
OpenAI — Function calling — OpenAI
OpenAI Agents SDK — OpenAI