Thuta Learning
ရှာဖွေရန်
ProjectsAIbeginner

Agent Tools and Actions

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • Agent Tools and Actions ကို ကြောက်စရာမလိုအောင် နားလည်မယ်
  • ကိုယ်တိုင် စမ်းသုံးတတ်အောင် လုပ်မယ်
  • မှားလွယ်တဲ့နေရာကို ပြုံးပြီး ရှောင်တတ်မယ်

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 လုပ်ပါတယ်။

Agent Tools and Actions lesson illustration
Agents, Privacy, and Project — Agent Tools and Actions

နေ့စဉ်ဘဝနဲ့ ချိတ်ကြည့်မယ်

Tool တစ်ခုကို တာဝန်တစ်ခုတည်းထားပြီး parameters ကိုတိကျစေပါ။ “manage_everything” လို tool ကြီးမလုပ်ပါနှင့်။ Read tool နဲ့ write tool ခွဲပြီး write action မှာ confirmation သို့မဟုတ် idempotency key သုံးပါ။

အတူတူ လက်တွေ့စမ်းမယ်

javascript
const tools = [{
  type: "function",
  name: "get_weather",
  description: "မြို့တစ်မြို့၏ လက်ရှိမိုးလေဝသကို ရယူရန်",
  parameters: {
    type: "object",
    properties: { city: { type: "string" } },
    required: ["city"],
    additionalProperties: false,
  },
  strict: true,
}];
You should see
Schema တိကျတဲ့ read-only agent tool တစ်ခု သတ်မှတ်နိုင်မည်။

၅ မိနစ် စမ်းကြည့်

Course search tool တစ်ခုနဲ့ enrollment write tool တစ်ခုရေးပါ။ Enrollment မလုပ်မီ user confirmation လိုကြောင်း rule ထည့်ပါ။

သတိလေးတစ်ချက်

AI output ကို အပြီးသတ်အမှန်လို့မယူပါနှင့်။ အရေးကြီးတဲ့အချက်၊ code နဲ့ user data ကို လူကပြန်စစ်ပြီးမှ အသုံးပြုပါ။

OpenAI — Function callingOpenAI

OpenAI Agents SDKOpenAI

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • Model arguments ကို validate မလုပ်ဘဲ execute ခြင်း
  • Read နဲ့ destructive write action ကို tool တစ်ခုတည်းထားခြင်း

လေ့ကျင့်ခန်း

Course search tool တစ်ခုနဲ့ enrollment write tool တစ်ခုရေးပါ။ Enrollment မလုပ်မီ user confirmation လိုကြောင်း rule ထည့်ပါ။

You'll know it worked when: Schema တိကျတဲ့ read-only agent tool တစ်ခု သတ်မှတ်နိုင်မည်။

Agent Tools and Actions | Thuta Learning