ai-agents-for-beginners

ယုံကြည်စိတ်ချရသော AI ကိုယ်စားလှယ်များ

(ဤစာသင်ခန်း၏ဗီဒီယိုကိုကြည့်ရန် ဓာတ်ပုံကိုနှိပ်ပါ)

ယုံကြည်စိတ်ချရသော AI ကိုယ်စားလှယ်များ တည်ဆောက်ခြင်း

နိဒါန်း

ဤသင်ခန်းတွင် ပါဝင်ပါသည် -

သင်ယူရမည့်ရည်မှန်းချက်များ

ဤသင်ခန်းပြီးဆုံးချိန်တွင်၊ သင်သည် သိရှိမည်မှာ -

လုံခြုံရေး

ပထမဦးစွာ ဘေးကင်းလုံခြုံသော ကိုယ်စားလှယ် applications များတည်ဆောက်ခြင်းကို ကြည့်ကြမယ်။ လုံခြုံရေးဆိုသည်မှာ AI ကိုယ်စားလှယ်သည် ဒီဇိုင်ထိန်းသိမ်းထားသည့်အတိုင်း လုပ်ဆောင်ခြင်းကို ဆိုလိုသည်။ ကိုယ်စားလှယ် applications များကို တည်ဆောက်သူများအနေဖြင့် လုံခြုံရေးအတောအတွင်း ပိုမိုမြှင့်တင်ရန် နည်းစနစ်များနှင့် ကိရိယာများ ရှိသည်။

စနစ်သတိပေးချက် ဖောင်မြင့်တည်ဆောက်ခြင်း

သင့်မှာ အကြီးစား ဘာသာစကား မော်ဒယ်များ (LLMs) ဖြင့် AI application တည်ဆောက်ဖူးလျှင် စနစ် prompt သို့မဟုတ် စနစ်သတိပေးချက် တစ်ခုအား ခိုင်မာစွာ ဒီဇိုင်းရေးဆွဲရခြင်း၏ အရေးကြီးမှုကို သိကြပါလိမ့်မည်။ ဒီသတိပေးချက်များသည် LLM အသုံးပြုသူနှင့် အချက်အလက်များအပေါ် ထိတွေ့ကြပါမည့် ဥပဒေကြီးများ၊ ညွှန်ကြားချက်များနှင့် လမ်းညွှန်ချက်များကို သတ်မှတ်သည်။

AI ကိုယ်စားလှယ်များအတွက် စနစ် prompt အရေးကြီးသည့်အနေဖြင့် ထူးခြားသော ညွှန်ကြားချက်များလိုအပ်မည်။ ၎င်းသည် ကျွန်ုပ်တို့ဒီဇိုင်းထားသည့်လုပ်ငန်းများ ပြီးမြောက်စေရန် ဖြစ်သည်။

ချဲ့ထွင်နိုင်သည့် စနစ် prompt များဖန်တီးရန်၊ ကျွန်ုပ်တို့သည် application တွင် ကိုယ်စားလှယ်တစ်ခု သို့မဟုတ် တစ်ခုထက်ပို အတွက် စနစ်သတိပေးချက် ဖောင်မြင့်ကို အသုံးပြုနိုင်ပါသည် -

စနစ်သတိပေးချက် ဖောင်မြင့်တည်ဆောက်ခြင်း

အဆင့် ၁: meta စနစ်သတိပေးချက် ဖန်တီးခြင်း

meta prompt သည် LLM သုံး၍ ကျွန်ုပ်တို့ ဖန်တီးမည့် ကိုယ်စားလှယ်များအတွက် စနစ် prompt များ ထုတ်လုပ်ရန် အသုံးပြုမည်။ တစ်ခါတည်း လုပ်ဆောင်ရာတွင် ကောင်းမွန်ပြီး ထိရောက်သော နည်းစနစ် template အဖြစ် ဒီဇိုင်းရေးဆွဲထားသည်။

၎င်းသည် LLM သို့ ပေးပို့မည့် meta system message ဥပမာဖြစ်သည် -

You are an expert at creating AI agent assistants. 
You will be provided a company name, role, responsibilities and other
information that you will use to provide a system prompt for.
To create the system prompt, be descriptive as possible and provide a structure that a system using an LLM can better understand the role and responsibilities of the AI assistant. 

အဆင့် ၂: အခြေခံ prompt ဖန်တီးခြင်း

နောက်တစ်ဆင့်မှာ AI ကိုယ်စားလှယ်ကို ဖော်ပြသော အခြေခံ prompt တစ်ခု ဖန်တီးပါ။ ကိုယ်စားလှယ်၏ အခန်းကဏ္ဍ၊ ပြီးမြောက်မည့် လုပ်ငန်းများနှင့်တာဝန်များ ထည့်သွင်းရေးပါ။

ဤမှာ ဥပမာ တစ်ခုဖြစ်သည်-

You are a travel agent for Contoso Travel that is great at booking flights for customers. To help customers you can perform the following tasks: lookup available flights, book flights, ask for preferences in seating and times for flights, cancel any previously booked flights and alert customers on any delays or cancellations of flights.  

အဆင့် ၃: အခြေခံ စနစ်သတိပေးချက်ကို LLM ထံ ပေးပို့ခြင်း

ယခု meta system message နှင့် basic system message ကိုပေး၍ စနစ်သတိပေးချက်ကို တိုးတက်ကောင်းမွန်စေရန် ပြုလုပ်နိုင်ပါသည်။

၎င်းက ကျွန်ုပ်တို့ AI ကိုယ်စားလှယ်များ အသုံးပြုရန် သင့်တော်သော စနစ်သတိပေးချက် တစ်ခုကို ထုတ်ပေးမည်ဖြစ်သည်။

**Company Name:** Contoso Travel  
**Role:** Travel Agent Assistant

**Objective:**  
You are an AI-powered travel agent assistant for Contoso Travel, specializing in booking flights and providing exceptional customer service. Your main goal is to assist customers in finding, booking, and managing their flights, all while ensuring that their preferences and needs are met efficiently.

**Key Responsibilities:**

1. **Flight Lookup:**
    
    - Assist customers in searching for available flights based on their specified destination, dates, and any other relevant preferences.
    - Provide a list of options, including flight times, airlines, layovers, and pricing.
2. **Flight Booking:**
    
    - Facilitate the booking of flights for customers, ensuring that all details are correctly entered into the system.
    - Confirm bookings and provide customers with their itinerary, including confirmation numbers and any other pertinent information.
3. **Customer Preference Inquiry:**
    
    - Actively ask customers for their preferences regarding seating (e.g., aisle, window, extra legroom) and preferred times for flights (e.g., morning, afternoon, evening).
    - Record these preferences for future reference and tailor suggestions accordingly.
4. **Flight Cancellation:**
    
    - Assist customers in canceling previously booked flights if needed, following company policies and procedures.
    - Notify customers of any necessary refunds or additional steps that may be required for cancellations.
5. **Flight Monitoring:**
    
    - Monitor the status of booked flights and alert customers in real-time about any delays, cancellations, or changes to their flight schedule.
    - Provide updates through preferred communication channels (e.g., email, SMS) as needed.

**Tone and Style:**

- Maintain a friendly, professional, and approachable demeanor in all interactions with customers.
- Ensure that all communication is clear, informative, and tailored to the customer's specific needs and inquiries.

**User Interaction Instructions:**

- Respond to customer queries promptly and accurately.
- Use a conversational style while ensuring professionalism.
- Prioritize customer satisfaction by being attentive, empathetic, and proactive in all assistance provided.

**Additional Notes:**

- Stay updated on any changes to airline policies, travel restrictions, and other relevant information that could impact flight bookings and customer experience.
- Use clear and concise language to explain options and processes, avoiding jargon where possible for better customer understanding.

This AI assistant is designed to streamline the flight booking process for customers of Contoso Travel, ensuring that all their travel needs are met efficiently and effectively.

အဆင့် ၄: ထပ်ခါတလဲလဲပြုလုပ်ခြင်းနှင့် အဆင်ပြေမှုမြှင့်တင်ခြင်း

စနစ်သတိပေးချက် ဖောင်မြင့်၏ အခွန်မှာ ကိုယ်စားလှယ်များစွာအတွက် စနစ်သတိပေးချက်များ ရိုးရှင်းစွာ တိုးချဲ့ဖန်တီးနိုင်ခြင်းနဲ့ စနစ်သတိပေးချက်များကို အချိန်ကြာမြင့်စွာ တိုးတက်အောင် ပြုလုပ်နိုင်ခြင်း ဖြစ်သည်။ ပထမဆုံး ကြိမ်အတွက် မိမိအခြေအနေ ပြည့်စုံသော စနစ်သတိပေးချက် ရရှိခြင်းသည် အရမ်းနည်းပါ။ အခြေခံ စနစ်သတိပေးချက် ပြောင်းလဲပြီး စနစ်တစ်ခုဖြတ်၍ လုပ်ဆောင်ခြင်းဖြင့် ငယ်ငယ်ရွယ်ရွယ် ပြင်ဆင်မှုများ ပြုလုပ်ကာ ရလဒ်များကို နှိုင်းယှဉ် သုံးသပ်နိုင်ပါသည်။

ခြိမ်းခြောက်မှုများကို နားလည်ခြင်း

ယုံကြည်စိတ်ချရသော AI ကိုယ်စားလှယ်များ ဖန်တီးရန် အန္တရာယ်နှင့် ခြိမ်းခြောက်မှုများကို နားလည်ကာ လျှော့ချရန် အရေးကြီးသည်။ AI ကိုယ်စားလှယ်များအား ခြိမ်းခြောက်မှုပုံစံအချို့နှင့် ယင်းတို့အတွက် ပိုမိုကောင်းမွန်စွာ စီစဉ်ရေးဆွဲနိုင်ရန်ကြည့်ကြမည်။

ခြိမ်းခြောက်မှုများကို နားလည်ခြင်း

အလုပ်တာဝန်နှင့် ညွှန်ကြားချက်

ဖော်ပြချက်: တိုက်ခိုက်သူများသည် AI ကိုယ်စားလှယ်၏ ညွှန်ကြားချက်များ သို့မဟုတ် ရည်မှန်းချက်များကို prompt ဖန်တီးခြင်း သို့မဟုတ် မာနဖြင့် ပြောင်းလဲရန်ကြိုးပမ်းသည်။

ကာကွယ်ထိန်းသိမ်းမှု: အန္တရာယ်ရှိနိုင်သော prompt များကို AI ကိုယ်စားလှယ် ချိန်ဆ ထိတွေ့မှီ အစောပိုင်းသတိပေးရန် စစ်ဆေးမှုများနှင့် input စိစစ်မှုများ ပြုလုပ်ပါ။ ဤကုန်ကျရှိလာသောတိုက်ခိုက်မှုများသည် AI ကိုယ်စားလှယ်နှင့် မကြာခဏ အပြန်အလှန် ဆက်သွယ်မှုလိုအပ်သော်လည်း၊ စကားဝိုင်းတွင် လှည့်ကွက် အရေတွက်ကို သတ်မှတ်ခြင်းဖြင့် ဤတိုက်ခိုက်မှုများကို ကာကွယ်နိုင်ပါသည်။

အရေးကြီး စနစ်များ ရရှိခွင့်

ဖော်ပြချက်: AI ကိုယ်စားလှယ်သည် ဒေတာများကို သိမ်းဆည်းထားသည့် စနစ်နှင့် ဝန်ဆောင်မှုများရရှိနိုင်လျှင် အဆိုပါ စနစ်နှင့် ကိုယ်စားလှယ်အကြား ဆက်သွယ်မှုကို တိုက်ခိုက်သူများမှ ဖျက်ဆီးနိုင်သည်။ ၎င်းများမှာ တိုက်ခိုက်မှုတိုက်ရိုက်သို့မဟုတ် ကိုယ်စားလှယ်မှတဆင့် စနစ်အကြောင်းအချက်အလက် ရယူရန် ကြိုးပမ်းမှုဖြစ်နိုင်သည်။

ကာကွယ်ထိန်းသိမ်းမှု: အဆိုပါ တိုက်ခိုက်မှုမျိုးများမှ ကာကွယ်ရန် AI ကိုယ်စားလှယ်သည် စနစ်များကို လိုအပ်သည့်အချိန်တွင်သာ ရယူခွင့် ပေးရန်ရှိသင့်သည်။ အဆိုပါ အကြားဆက်သွယ်မှုများလည်း လုံခြုံစေသင့်သည်။ အတည်ပြုခြင်းနဲ့ လက်လျှောက်ခွင့် ထိန်းချုပ်မှုများကို ထည့်သွင်းကာ ဤသတင်းအချက်အလက်များကို ကာကွယ်သင့်သည်။

ရင်းနှီးမြှုပ်နှံမှုနှင့် ဝန်ဆောင်မှု များလွှမ်းခြုံမှုပြဿနာ

ဖော်ပြချက်: AI ကိုယ်စားလှယ်များသည် ဖြည့်ဆည်းပေးမှုများ နှင့် ဝန်ဆောင်မှုများကို အသုံးပြုကာ လုပ်ငန်းများ ပြီးမြောက်စေနိုင်သည်။ တိုက်ခိုက်သူများသည် ဒီအခွင့်အရေးကို အသုံးပြုကာ ဝန်ဆောင်မှုများကို AI ကိုယ်စားလှယ်မှတဆင့် များစွာသော မှတ်တမ်းတင်မှုများ ပို့ခြင်းဖြင့်တိုက်ခိုက်နိုင်ပြီး နောက်ဆက်တွဲစနစ်အလုပ်ပျက်မှု သို့မဟုတ် တွန်းထားသည့်ကုန်ကျစရိတ်များ ဖြစ်ပေါ်စေနိုင်သည်။

ကာကွယ်ထိန်းသိမ်းမှု: AI ကိုယ်စားလှယ်များ ဝန်ဆောင်မှုတစ်ခုတည်းသို့ လုပ်ဆောင်နိုင်မှု အရေအတွက်ကို အကန့်အသတ်ထားရန် မူဝါဒများ ထည့်သွင်းပါ။ သင်၏ AI ကိုယ်စားလှယ်အား စကားပြောအလှည့်အပြောင်း နဲ့ တောင်းဆိုမှု အရေအတွက် အကန့်အသတ်ခြင်းက ဤတိုက်ခိုက်မှုများကာကွယ်နိုင်ပါသည်။

ဗဟုသုတ အချက်အလက်စုဆောင်းခြင်း သန္ဓေဒူးနှင့် ထိခိုက်မှု

ဖော်ပြချက်: ဤတိုက်ခိုက်မှုသည် AI ကိုယ်စားလှယ်ကို တိုက်ရိုက် ထိခိုက်စေခြင်းမဟုတ်ပေ။ သို့သော် AI ကိုယ်စားလှယ် အသုံးပြုမယ့် ဗဟုသုတအချက်အလက်လုပ်ငန်း စနစ်များ အပေါ် တိုက်ရိုက်သို့မဟုတ် အချက်အလက် မမှန်ကန်စေခြင်းဖြင့် အသေးစိတ် အချက်အလက်များကို ထိခိုက်စေပါသည်။ ၎င်းက ဇယားဖြင့် သုံးစွဲသူအား မတူညီသော သို့မဟုတ် မလိုလားအပ်သော တုံ့ပြန်မှုများ ပေးစေမည်ဖြစ်သည်။

ကာကွယ်ထိန်းသိမ်းမှု: AI ကိုယ်စားလှယ်၏ လုပ်ငန်းစဉ်များတွင် အသုံးပြုမည့် ဒေတာများကို ပုံမှန် စစ်ဆေးသေချာစေရန်လုပ်ပါ။ ဤဒေတာကို သာယာသောလူများသာ ပြင်ဆင်ခွင့်ပြုခြင်းနှင့် လုံခြုံရေးကာကွယ်မှုရှိနေစေရန် သေချာစေရန် လုပ်ဆောင်ပါ။

အမှားများ ရွှဲလောင်းဆက်တိုက် ဖြစ်ပေါ်ခြင်း

ဖော်ပြချက်: AI ကိုယ်စားလှယ်သည် အလုပ်တာဝန်များ ပြီးမြောက်ရန် ကိရိယာများနှင့် ဝန်ဆောင်မှုများ အသုံးပြုသည်။ တိုက်ခိုက်သူများ ကြောင့် ဖြစ်ပေါ်သော အမှားများသည် AI ကိုယ်စားလှယ် ဆက်သွယ်နေသော အခြားစနစ်များ ပျက်ကပ်မှု ဖြစ်ပေါ်စေရန် ဆောင်ရွက်နိုင်သည်။ ၎င်းကြောင့်တိုက်ခိုက်မှု ပိုမိုကန့်လန့်ပြီး ပြဿနာရှာဖွေရန် ခက်ခဲလာမည်။

ကာကွယ်ထိန်းသိမ်းမှု: ဤအမျိုးအစားတိုက်ခိုက်မှုကင်းရှင်းရန် AI ကိုယ်စားလှယ်ကို ကန့်သတ်ထားသောပတ်ဝန်းကျင် တစ်ခုတွင် လုပ်ဆောင်စေခြင်း (ဥပမာ Docker container အတွင်း လုပ်ဆောင်ခြင်း) ပါဝင်သည်။ အချို့စနစ် အမှား တုံ့ပြန်လျှင် fallback မက်ကန်နိဇ်များနှင့် ပြန်လည်ကြိုးစားမှုများ ဖန်တီးခြင်းက ပိုမိုအကြီးစား စနစ် ပျက်ကပ်မှုကင်းရှင်းစေသည်။

လူသား ပါဝင်ခြင်း (Human-in-the-Loop)

ယုံကြည်စိတ်ချရသော AI ကိုယ်စားလှယ် စနစ်များ တည်ဆောက်ရာတွင် လူသား ပါဝင်မှု နည်းလမ်းတစ်ခု ဖြစ်ပါသည်။ ၎င်းသည် အသုံးပြုသူများအား AI ကိုယ်စားလှယ်များ ပတ်သက်စဉ် ပြန်လည်တုံ့ပြန်မှုပေးရန်ခွင့် ပြုသည်။ အသုံးပြုသူများသည် multi-agent စနစ်၌ ကိုယ်စားလှယ် များအဖြစ် လုပ်ဆောင်ကာ လက်မှတ်ပေးခြင်း (approval) သို့မဟုတ် လုပ်ဆောင်မှု ရပ်ဆိုင်းခြင်းကို ပြုလုပ်နိုင်သည်။

လူသား ပါဝင်ခြင်း

ဤအယူအဆကို Microsoft Agent Framework အသုံးပြုပြ သည့် ကုဒ်စံနမူနာ -

import os
from agent_framework.foundry import FoundryChatClient
from azure.identity import AzureCliCredential

# လူတစ်ဦး၏ အတည်ပြုချက်နဲ့ ပရိုဗိုင်းဒါကို ဖန်တီးပါ
provider = FoundryChatClient(
    project_endpoint=os.environ["AZURE_AI_PROJECT_ENDPOINT"],
    model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
    credential=AzureCliCredential(),
)

# လူ့အတည်ပြုခြင်းအဆင့်ပါသော ကိုယ်စားလှယ်ကို ဖန်တီးပါ
response = provider.create_response(
    input="Write a 4-line poem about the ocean.",
    instructions="You are a helpful assistant. Ask for user approval before finalizing.",
)

# အသုံးပြုသူသည် ပြန်ကြားချက်ကို ပြန်လည်ဆန်းစစ်ပြီး အတည်ပြုနိုင်သည်
print(response.output_text)
user_input = input("Do you approve? (APPROVE/REJECT): ")
if user_input == "APPROVE":
    print("Response approved.")
else:
    print("Response rejected. Revising...")

နိဂုံး

ယုံကြည်စိတ်ချရသော AI ကိုယ်စားလှယ်များ ဖန်တီးရန် ပြုလုပ်မှု ဒီဇိုင်း သေချာမှု၊ ခိုင်မာသော လုံခြုံရေးအကောင်အထည်ဖော်မှုနှင့် ဆက်တိုက် ပြန်လည်တိုးတက်မှုများ လိုအပ်သည်။ သေချာစွာ စနစ် meta prompting များဖန်တီးခြင်း၊ ဖြစ်နိုင်သောခြိမ်းခြောက်မှုများ နားလည်ခြင်းနှင့် ကာကွယ်ရေး မဟာဗျူဟာများ အကောင်အထည်ဖော်ခြင်းဖြင့် ထိရောက်ပြီးလုံခြုံသော AI ကိုယ်စားလှယ်များ ဖန်တီးနိုင်သည်။ ထို့နောက် လူသား ပတ်သက်မှုပါဝင်မှုနည်းလမ်းကို ထည့်သွင်းခြင်းက AI ကိုယ်စားလှယ်များအနေဖြင့် အသုံးပြုသူလိုအပ်ချက်နှင့် ကိုက်ညီနေပြီး အန္တရာယ်များ များအတိုင်း လူမှုခရီးများလျော့နည်းစေသည်။ AI တိုးတက်မှု၊ လုံခြုံရေး၊ privacyနှင့် ဓါတ်သဘာဝဆိုင်ရာ စဉ်ဆက်မပြတ် သတိထားမှုများဖြင့် အချိန်မီ ကြိုတင်ကာကွယ်ခြင်းသည် AI မောင်းနှင်သော စနစ်များတွင် ယုံကြည်စိတ်ချရမှုနှင့် ယုံကြည်မှု ထောက်ပံ့ရန်အတွက် အဓိကဖြစ်လိမ့်မည်။

ကုဒ် စံနမူနာများ

ယုံကြည်စိတ်ချရသော AI ကိုယ်စားလှယ်များ ဖန်တီးခြင်း၊ပိုမိုမေးမြန်းလိုပါသလား?

အခြားလေ့လာသူများနှင့် တွေ့ဆုံရန်၊ ရုံးအချိန်များ ဧည့်သည်လာရန်နှင့် AI ကိုယ်စားလှယ်များ ချက်များကို ဖြေဆိုရန် Microsoft Foundry Discord တွင် ပါဝင်ဆွေးနွေးလိုက်ပါ။

အပိုဆောင်း အရင်းအမြစ်များ

ယခင် သင်ခန်းစာ

Agentic RAG

နောက်တစ်ခါ သင်ခန်းစာ

စီမံကိန်းဒီဇိုင်း ပုံစံ


ပြောကြားချက် ဤစာတမ်းကို AI ဘာသာပြန်ဝန်ဆောင်မှု Co-op Translator အသုံးပြု၍ ဘာသာပြန်ထားပါသည်။ ကျွန်ုပ်တို့သည် တိကျမှန်ကန်မှုအတွက် ကြိုးပမ်းနေသော်လည်း၊ စက်ကိရိယာဘာသာပြန်ခြင်းများတွင် အမှားများ သို့မဟုတ် မှားယွင်းချက်များ ပါဝင်နိုင်ကြောင်း သတိပြုပါရန် လိုအပ်ပါသည်။ မူလစာတမ်းကို မူရင်းဘာသာဖြင့်သာ ယုံကြည်စိတ်ချရသော အချက်အလက်အဖြစ် သတ်မှတ်သင့်သည်။ အရေးကြီးသည့် သတင်းအချက်အလက်များအတွက် ပရော်ဖက်ရှင်နယ် လူသားဘာသာပြန်သူဝန်ဆောင်မှုကို အကြံပြုပါသည်။ ဤဘာသာပြန်ချက်ကို အသုံးပြုခြင်းမှ ဖြစ်ပေါ်လာသော နားလည်မှုကွာခြားမှုများ သို့မဟုတ် မမှန်ကန်သော အသုံးပြုမှုများအတွက် ကျွန်ုပ်တို့ တာဝန်မခံပါ။