> For the complete documentation index, see [llms.txt](https://docs.tlic.cmu.ac.th/cmu-matthew-ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tlic.cmu.ac.th/cmu-matthew-ai/use-cases/techniques.md).

# เทคนิคการเขียนคำสั่ง (Prompt Engineering)

Prompt Engineering เป็นกลยุทธ์ในการใช้ข้อความหรือคำสั่งเพื่อกระตุ้นให้ระบบ AI สร้างผลลัพธ์ตามที่ต้องการ เทคนิคนี้ช่วยให้ได้ผลลัพธ์ที่มีประสิทธิภาพและตรงกับเป้าหมายที่ตั้งไว้มากขึ้น โดยการใช้รูปแบบ (Pattern) ที่เหมาะสม

#### ตัวอย่าง Prompt Techniques

1. <mark style="color:red;">**Personal Pattern**</mark> [The Persona Pattern](/cmu-matthew-ai/use-cases/techniques/the-persona-pattern.md)\
   การออกแบบคำสั่งโดยมุ่งเน้นไปที่ความต้องการ ข้อมูลพื้นฐาน หรือบริบทส่วนบุคคล เพื่อให้ผลลัพธ์ที่ได้มีความเฉพาะด้านและตรงกับผู้ใช้มากที่สุด
2. <mark style="color:red;">**Audience Pattern**</mark> [The Audience Persona Pattern](/cmu-matthew-ai/use-cases/techniques/the-audience-persona-pattern.md)\
   การออกแบบคำสั่งที่คำนึงถึงผู้รับสารหรือกลุ่มเป้าหมายที่ต้องการสื่อสาร โดยกำหนดการใช้ภาษาหรือบริบทให้เหมาะสมกับกลุ่มเป้าหมาย
3. [<mark style="color:red;">**Chain of Thought (CoT) Pattern**</mark>](/cmu-matthew-ai/use-cases/techniques/chain-of-thought-pattern.md) [Chain of Thought (CoT) Pattern](/cmu-matthew-ai/use-cases/techniques/chain-of-thought-pattern.md)\
   การกระตุ้นให้ AI คิดเป็นลำดับขั้นตอนเพื่อให้ได้คำตอบที่ซับซ้อนและมีเหตุผลมากขึ้น โดยสามารถใช้คำสั่งเช่น "อธิบายเป็นขั้นตอน" หรือ "ช่วยวิเคราะห์ปัญหานี้ทีละขั้นตอน"
4. [<mark style="color:red;">**Zero-shot และ Few-shot Prompting**</mark>](/cmu-matthew-ai/use-cases/techniques/zero-shot-and-few-shot-prompting.md)  [Zero Shot and Few Shot Prompting](/cmu-matthew-ai/use-cases/techniques/zero-shot-and-few-shot-prompting.md)
   * **Zero-shot Prompting:** การให้ AI ทำงานโดยไม่มีตัวอย่างมาก่อน เช่น "อธิบายแนวคิดของเศรษฐศาสตร์พฤติกรรม"
   * **Few-shot Prompting:** การให้ตัวอย่างบางส่วนเพื่อให้ AI เข้าใจแนวทางก่อน เช่น "ตัวอย่างของข้อความเชิญงานคือ... กรุณาสร้างข้อความเชิญงานในลักษณะเดียวกัน"
