Modernizing Organization with Generative AI - Workbook
  • UB00 - How to use this book
    • UB00A - How to Access Copilot, Gemini, ChatGPT, and Claude
  • UB01 - List of Fun Prompts You Can Try on Any AI Assistant
  • UB02 - Write a Social Media Post with ChatGPT + Copilot + Claude
  • UB03 - Search & Browse the Web with Copilot
  • UB04 - ก้าวข้ามอุปสรรคทางภาษาด้วย Claude
  • UB05 - ChatGPT & Gemini as Writing Assistants
  • UB06 - Image Question Answering Feature
  • UPE01 - Applying Prompt Engineering to Get the Most Out of Your AI Assistants
  • UPE02 - Requesting Structured Outputs for Clarity and Efficiency
  • UPE03 - Creating Structured Prompts to Share with Your Team
  • UPE04 - Master-Level Prompt Engineering
    • UPE04 [TH] - Prompt Engineering ขั้นสูง
  • [BI] Generative AI in Qlik
  • [BI] Einstein Copilot for Tableau
  • [BI] Microsoft 365 Copilot for Excel
  • [BI] Copilot for Power BI
  • UPE05 - Data Analytics with ChatGPT
Powered by GitBook
On this page
  • 👩🏻‍💼 Persona
  • 🚀 Learning Objectives
  • 🛠️ Tools
  • Providing Context
  • Start small and iterate your prompt with more and more context
  • Short prompts are for beginners. AI performs better with more context.
  • Build a good prompt once, use forever
  • Providing Examples
  • 👩🏻‍💼 Persona
  • Collect Samples for Your Team

UPE01 - Applying Prompt Engineering to Get the Most Out of Your AI Assistants

This set of exercises discuss prompt engineering techniques. In this lesson, we start with the 2 basic, yet powerful, prompting principles.

PreviousUB06 - Image Question Answering FeatureNextUPE02 - Requesting Structured Outputs for Clarity and Efficiency

Last updated 9 months ago

👩🏻‍💼 Persona

You are an IT manager in charge of helping HR write a job description for a junior data engineer position. You are coming up with a good draft based on your knowledge of the role, responsibilities, and the required qualifications.

🚀 Learning Objectives

  1. Identifying and providing relevant context for prompts

  2. Finding effective examples to guide the model's output

  3. Iterating and refining prompts based on the model's responses

  4. Combining context and examples for optimal prompt engineering

🛠️ Tools

Providing Context

First, let's establish the baseline how ChatGPT write job description for the role without any context.

Try this prompt

Please draft a job description for a junior Data Engineer role.
Response I got

Job Title: Junior Data Engineer

Location: [Specify Location]

Company Overview: [Insert Company Name] is a [brief description of the company, its mission, and its values].

Position Overview: We are seeking a highly motivated and enthusiastic Junior Data Engineer to join our dynamic team. The ideal candidate will have a passion for data and technology, with a strong desire to learn and grow in a collaborative environment. As a Junior Data Engineer, you will work closely with our data engineering team to assist in the development, maintenance, and optimization of our data infrastructure and pipelines.

Key Responsibilities:

  • Assist in designing, building, and maintaining scalable data pipelines and ETL processes.

  • Collaborate with cross-functional teams to understand data requirements and develop solutions to meet business needs.

  • Support data integration efforts across various systems and platforms.

  • Perform data cleansing, transformation, and validation to ensure data quality and integrity.

  • Contribute to the development and implementation of data governance policies and best practices.

  • Assist in troubleshooting and resolving data-related issues in a timely manner.

  • Stay current with emerging technologies and industry trends in data engineering and analytics.

Qualifications:

  • Bachelor's degree in Computer Science, Engineering, Mathematics, or a related field.

  • Strong understanding of data structures, algorithms, and database concepts.

  • Proficiency in at least one programming language (e.g., Python, Java, Scala) and SQL.

  • Experience with data modeling, ETL tools, and workflow management systems (e.g., Apache Spark, Apache Airflow).

  • Familiarity with cloud platforms and services (e.g., AWS, GCP, Azure) is a plus.

  • Excellent problem-solving skills and attention to detail.

  • Strong communication and interpersonal skills, with the ability to collaborate effectively in a team environment.

  • Eagerness to learn and adapt to new technologies and methodologies.

Benefits:

  • Competitive salary

  • Comprehensive health benefits package

  • Retirement savings plan

  • Flexible work hours

  • Opportunities for professional development and training

  • Collaborative and inclusive work culture

How to Apply: Please submit your resume and cover letter outlining your qualifications and interest in the position to [Contact Email]. Be sure to include "Junior Data Engineer Application" in the subject line.

[Insert Company Name] is an equal opportunity employer and welcomes candidates from diverse backgrounds. We thank all applicants for their interest; however, only those selected for an interview will be contacted.

Not a bad response! But we might want to personalize it a bit.

The easiest way to provide context is to brain dump everything that you want and know about the task.

Please draft a job description for a junior data engineer role.

Here's my thoughts that should be incorporated:
- We have many SQL databases to deal with, definitely need strong SQL skill
- We want to explore cloud technology (AWS, Azure, GCP), but no solid project here, want someone with general experience and knowledge
- We use Python and Scala as primary programming language.
- Here are some tools we use: Github, Apache Kafka, MongoDB
- Please write in Thai
Response I got (only the parts that are relevant)

ความรับผิดชอบหลัก:

  • พัฒนาและบำรุงรักษาสคริปต์และคิวรี SQL สำหรับกระบวนการการสกัดข้อมูล การแปลงข้อมูล และการโหลด (ETL)

  • ร่วมงานกับทีมหลายฝ่ายเพื่อออกแบบ สร้าง และปรับปรุงท่อไฟท์ข้อมูลและกระบวนการงาน

  • ช่วยในการสำรวจและการนำเทคโนโลยีคลาวด์ เช่น AWS, Azure และ GCP เข้าสู่การใช้งานเพื่อเสริมความสามารถในการจัดเก็บข้อมูล การประมวลผล และการวิเคราะห์ข้อมูล

  • สร้างแอปพลิเคชันประมวลผลข้อมูลโดยใช้ภาษาโปรแกรม Python และ Scala

  • ใช้เครื่องมือควบคุมเวอร์ชัน เช่น GitHub สำหรับการพัฒนาร่วมกันและการจัดการโค้ด

  • สนับสนุนการผสานและการดูแลระบบสตรีมมิ่ง เช่น Apache Kafka เพื่อการประมวลผลข้อมูลแบบเรียลไทม์

  • ช่วยในการจัดการและบำรุงรักษาฐานข้อมูล NoSQL เช่น MongoDB เพื่อการจัดเก็บและการเรียกข้อมูลแบบไม่เรียงลำดับ

คุณสมบัติ:

  • ปริญญาตรีในสาขาวิทยาการคอมพิวเตอร์ วิศวกรรม หรือสาขาที่เกี่ยวข้อง

  • มีความเชี่ยวชาญใน SQL พร้อมทั้งประสบการณ์ในการคิวรี การปรับปรุงและการจัดการฐานข้อมูลสัมพันธ์

  • ความคุ้นเคยกับแนวความคิดและบริการคลาวด์ โดยต้องการให้มีประสบการณ์ใน AWS, Azure หรือ GCP

  • ความเชี่ยวชาญในภาษาโปรแกรมอย่างน้อยหนึ่งภาษา โดยต้องการให้มีความสามารถในการเขียนโค้ดที่สะอาดและมีประสิทธิภาพ

  • มีประสบการณ์ในระบบการควบคุมเวอร์ชันเช่น Git และกระบวนการการพัฒนาร่วมกัน

  • ความรู้ในแพลตฟอร์มสตรีมมิ่ง เช่น Apache Kafka และบทบาทของมันในการประมวลผลข้อมูลแบบเรียลไทม์

  • ความคุ้นเคยกับฐานข้อมูล NoSQL เช่น MongoDB และการใช้งานสำหรับการจัดเก็บและการเรียกข้อมูลที่ไม่เรียงลำดับ

  • ทักษะในการแก้ปัญหาที่แข็งแกร่งพร้อมความสนใจที่ดีในการเรียนรู้และพัฒนาต่อเนื่อง

If you have no idea what context to provide, you can just state your objective and ask ChatGPT for the context it wants.

I want you to draft a job description for a junior data engineer role.

I want a great JD that will attract talented junior engineers. To ensure you do an outstanding job, what information would you require from me? Please list the context needed in short bullets, and I will supply them and then you can write the JD based on my input.
Response I Got

To craft a compelling job description for a junior data engineer role, I'll need some key information from you:

  1. Company Background:

    • Overview of your company's industry, mission, and culture.

  2. Job Responsibilities:

    • Specific tasks and duties the junior data engineer will be expected to perform.

  3. Required Skills:

    • Technical skills, programming languages, and tools necessary for the role.

  4. Preferred Qualifications:

    • Any additional skills or experience that would be beneficial but not mandatory.

  5. Education and Experience:

    • Preferred educational background (e.g., degree in computer science, statistics, etc.) and any minimum experience requirements.

  6. Company Values and Culture:

    • Any specific values or cultural aspects you want to emphasize to potential candidates.

  7. Benefits and Perks:

    • Information about what the company offers in terms of compensation, benefits, and any unique perks.

Once I have this information, I can create a job description that effectively communicates the opportunity and attracts talented junior engineers to your organization.

The more context you provide the more you can get the output to match your expectation.

Please draft a job description for a junior data engineer role.

Here are the context you asked for:

Here's my thoughts that should be incorporated:
- We have many SQL databases to deal with, definitely need strong SQL skill
- We want to explore cloud technology (AWS, Azure, GCP), but no solid project here, want someone with general experience and knowledge
- We use Python and Scala as primary programming language.
- Here are some tools we use: Github, Apache Kafka, MongoDB
- Please write in Thai

Company
- บริษัท ซีพี ออลล์ จํากัด (มหาชน) 
- ก่อตั้งปี 2531
- แบรนด์ที่ได้รับความนิยมและไว้วางใจ
- ประกอบธุรกิจหลัก คือ ธุรกิจค้าปลีกประเภทร้านค้าสะดวกซื้อภายใต้เครื่องหมายการค้า เซเว่น อีเลฟเว่น ในประเทศไทย

Perks
- วัฒนธรรมองค์กรเป็นกันเอง ร่วมมือกัน และเรียนรู้อย่างต่อเนื่อง
- โปรแกรมฝึกอบรมที่ดีเยี่ยมเพื่อพัฒนาทักษะและจิตใจ ส่งเสริมสุขภาพและความเป็นอยู่ที่ดีของพนักงาน
- ค่าตอบแทนสูงตามอัตราตลาด โบนัสดี
- ทริปท่องเที่ยวประจำปีกับทีมงาน

Please write a compelling JD using info I give you above. Please write in your own words, don't copy my content.
Response I got

ตำแหน่ง: Junior Data Engineer

สถานที่ทำงาน: บริษัท ซีพี ออลล์ จํากัด (มหาชน), [เมือง, รัฐ] แผนก: Data Engineering รายงานถึง: Senior Data Engineer / Data Engineering Manager

เกี่ยวกับบริษัท:

บริษัท ซีพี ออลล์ จํากัด (มหาชน) ก่อตั้งขึ้นในปี 2531 เป็นแบรนด์ที่ได้รับความนิยมและไว้วางใจในธุรกิจค้าปลีกผ่านร้านสะดวกซื้อภายใต้เครื่องหมายการค้า "เซเว่น อีเลฟเว่น" ในประเทศไทย เรามุ่งเน้นการใช้ข้อมูลเพื่อขับเคลื่อนการเติบโตและนวัตกรรมในองค์กรของเรา

ภาพรวมของบทบาท:

เราเปิดรับตำแหน่ง Junior Data Engineer เพื่อเข้าร่วมทีมที่กำลังขยายตัว คุณจะมีบทบาทสำคัญในการช่วยออกแบบ พัฒนา และดูแลรักษา Data Pipelines และกระบวนการ ETL เพื่อให้ข้อมูลที่มีความถูกต้องและพร้อมใช้งานสำหรับการตัดสินใจทางธุรกิจ คุณจะได้ร่วมงานกับทีมวิศวกรข้อมูลระดับอาวุโสและมีโอกาสในการเรียนรู้เทคโนโลยีใหม่ ๆ

หน้าที่หลัก:

  • การพัฒนา Data Pipeline: ช่วยในการสร้างและจัดการ Data Pipelines รวมถึงกระบวนการ ETL เพื่อเชื่อมต่อข้อมูลจากแหล่งต่าง ๆ

  • การจัดการข้อมูล: ดูแลการไหลของข้อมูลเพื่อให้แน่ใจว่าข้อมูลมีความถูกต้องและพร้อมใช้งาน

  • การวิเคราะห์ข้อมูล: สนับสนุนทีมวิทยาศาสตร์ข้อมูลและนักวิเคราะห์ในการเตรียมข้อมูลสำหรับการวิเคราะห์

  • การจัดทำเอกสาร: จัดทำเอกสารกระบวนการและการตั้งค่าเพื่ออ้างอิงและการปฏิบัติตาม

  • การแก้ไขปัญหา: ช่วยระบุและแก้ไขปัญหาที่เกี่ยวข้องกับข้อมูลและการประมวลผล

  • การพัฒนาต่อเนื่อง: มีส่วนร่วมในการปรับปรุงโครงสร้างพื้นฐานและกระบวนการข้อมูลที่มีอยู่

คุณสมบัติที่ต้องการ:

  • การศึกษา: ปริญญาตรีในสาขาวิทยาการคอมพิวเตอร์ วิศวกรรมศาสตร์ คณิตศาสตร์ หรือสาขาที่เกี่ยวข้อง

  • ทักษะทางเทคนิค: มีความเชี่ยวชาญใน SQL และมีความรู้ทั่วไปเกี่ยวกับเทคโนโลยีคลาวด์ (AWS, Azure, GCP)

  • ภาษาโปรแกรม: มีประสบการณ์การใช้ Python และ Scala ในการพัฒนา

  • เครื่องมือและเทคโนโลยี: คุ้นเคยกับ Github, Apache Kafka, และ MongoDB

  • ทักษะการแก้ปัญหา: สามารถวิเคราะห์และแก้ไขปัญหาได้ดี

  • การสื่อสาร: มีทักษะการสื่อสารที่ดีและสามารถทำงานร่วมกับทีมได้

  • ความสามารถในการปรับตัว: พร้อมที่จะเรียนรู้เทคโนโลยีใหม่ ๆ และปรับตัวตามความต้องการของโครงการ

สิ่งที่คุณจะได้รับ:

  • วัฒนธรรมองค์กร: สภาพแวดล้อมการทำงานที่เป็นกันเองและร่วมมือกัน พร้อมโอกาสในการเรียนรู้และเติบโตอย่างต่อเนื่อง

  • โปรแกรมฝึกอบรม: การฝึกอบรมที่ดีเยี่ยมเพื่อพัฒนาทักษะและความเป็นอยู่ที่ดีของพนักงาน

  • ค่าตอบแทนและโบนัส: ค่าตอบแทนที่สูงตามอัตราตลาดและโบนัสที่ดี

  • ทริปท่องเที่ยว: ทริปท่องเที่ยวประจำปีกับทีมงาน

วิธีการสมัคร:

ผู้ที่สนใจสามารถส่งประวัติย่อและจดหมายสมัครงานที่ระบุคุณสมบัติและความสนใจในตำแหน่งนี้ไปที่ [ที่อยู่อีเมลหรือลิงก์สมัคร]

บริษัท ซีพี ออลล์ จํากัด (มหาชน) เป็นนายจ้างที่เท่าเทียม เราฉลองความหลากหลายและมุ่งมั่นที่จะสร้างสภาพแวดล้อมที่ครอบคลุมสำหรับพนักงานทุกคน


หวังว่าคำอธิบายนี้จะตรงตามความต้องการของคุณ!

Key Lessons Learned

  1. Context info is very helpful for getting the AI to produce the results you want.

  2. You can ask the AI what context would be helpful for it to know to do the task well (and then give it the info it requests).

Start small and iterate your prompt with more and more context

Through this exercise, you've experienced firsthand the power of gradually adding context to your prompts. By starting with a basic prompt and then progressively introducing more relevant information, you've witnessed how the AI model's output quality improves incrementally.

This iterative approach to prompt engineering allows you to refine and guide the model's understanding, resulting in responses that become increasingly accurate, relevant, and tailored to your specific needs.

Short prompts are for beginners. AI performs better with more context.

Beginner AI users are usually captivated by concise prompts given away for free online, and expect immediate results. They often under appreciate the power of iterative prompt refinement, thinking that it is time-consuming and cumbersome.

Build a good prompt once, use forever

However, providing incremental context and refining prompts iteratively is invaluable, not unnecessary overhead. Note that this is the process all super users undergo to develop templates and workflows replacing their tedious daily tasks. Once effective prompts and templates are developed through this process, they will save you a ton of time.


Providing Examples

Examples are great for AI Assistants because:

  1. They provide a clear reference point for the desired output format, structure, tone, level of detail and style.

  2. Examples can be more effective than explicit instructions when the desired output is difficult to describe in words.

Situations where you should provide examples:

  1. You want AI to use certain tone and voice

  2. You want AI to speak to certain audience (e.g. children, parents, etc.)

  3. You want answers in specific formats

  4. You want AI to speak with the same level of technicality (speak like a doctor or a legal expert).

Good examples can be very powerful!

👩🏻‍💼 Persona

You are a head of the company's marketing department. You are writing a script for the agents to use.

Try this prompt

Here's an example prompt for generating customer service script, using examples.

ฉันเป็นหัวหน้าแผนกการตลาดของบริษัทและมีหน้าที่ในการพัฒนากลยุทธ์การตลาดเพื่อดึงดูดลูกค้าใหม่และรักษาลูกค้าเก่า

ฉันต้องการให้คุณช่วยสร้างสคริปต์ที่สามารถใช้ในการติดต่อกับลูกค้าที่เคยซื้อสินค้าของเราหรือมีความสนใจในสินค้า แต่ยังไม่ได้ซื้อภายในช่วงเวลาหนึ่ง

บริษัทเรามุ่งมั่นที่จะมอบประสบการณ์ที่ดีที่สุดให้กับลูกค้าและให้ความสำคัญกับความพึงพอใจของลูกค้าเป็นอันดับแรก ต่อไปนี้คือตัวอย่างสคริปต์ที่เราใช้ในการต้อนรับลูกค้าใหม่:

“สวัสดีค่ะคุณ [ชื่อลูกค้า] วันนี้เรามีความยินดีเป็นอย่างยิ่งที่ได้ต้อนรับคุณเข้าสู่ครอบครัวของเรา เรามีสินค้าหลายหลากที่สามารถตอบสนองความต้องการของคุณได้ ไม่ว่าจะเป็นผลิตภัณฑ์สำหรับอุปโภคบริโภค, อุปกรณ์เสริม, หรือของขวัญพิเศษ

ที่บริษัทเรามีการคัดสรรสินค้าคุณภาพสูงและบริการที่เอาใจใส่เพื่อให้คุณได้รับประสบการณ์การซื้อที่ดีที่สุด เรายินดีที่จะช่วยคุณเลือกสินค้าที่เหมาะสมกับความต้องการของคุณ และมั่นใจว่าคุณจะได้รับสินค้าที่ตอบโจทย์ทุกความต้องการของคุณ”

โปรดใช้ตัวอย่างสคริปต์นี้เป็นแนวทางในการเขียนสคริปต์ใหม่เพื่อกระตุ้นให้ลูกค้าทราบเกี่ยวกับโปรโมชั่นหรือสินค้าพิเศษที่เราเสนอ สคริปต์นี้ควรแจ้งให้ลูกค้าทราบเกี่ยวกับข้อเสนอหรือโปรโมชั่นพิเศษที่กำลังจัดอยู่ อธิบายถึงประโยชน์ของการใช้โปรโมชั่นนี้เพื่อเพิ่มคุณค่าและประสบการณ์ของลูกค้า ให้ข้อมูลเกี่ยวกับวิธีการรับข้อเสนอ ไม่ว่าจะเป็นการติดต่อกับเจ้าหน้าที่ฝ่ายขายหรือการซื้อผ่านเว็บไซต์ของเรา แนะนำให้ลูกค้าทำการซื้อหรือใช้โปรโมชั่นภายในช่วงเวลาที่กำหนด

Response I got

สวัสดีค่ะคุณ [ชื่อลูกค้า]

เราหวังว่าคุณจะมีช่วงเวลาที่ดีและสุขภาพแข็งแรงนะคะ เราอยากจะขอบคุณที่คุณเคยให้ความสนใจในสินค้าของเรามาก่อน และต้องการแนะนำคุณเกี่ยวกับโปรโมชั่นพิเศษที่เรากำลังจัดอยู่ในขณะนี้ค่ะ

ในช่วงเวลานี้ เรามีโปรโมชั่นพิเศษที่อาจเป็นสิ่งที่คุณกำลังมองหา ซึ่งรวมถึง [รายละเอียดของโปรโมชั่น เช่น ส่วนลด 20% สำหรับสินค้าทั้งหมด หรือของแถมพิเศษสำหรับการซื้อสินค้าครบ 1,000 บาท] โปรโมชั่นนี้เป็นโอกาสที่ดีในการเลือกซื้อสินค้าคุณภาพสูงจากเราในราคาพิเศษ

เราเชื่อว่าการใช้โปรโมชั่นนี้จะเพิ่มความคุ้มค่าและทำให้คุณได้รับประสบการณ์การซื้อที่ยอดเยี่ยมยิ่งขึ้นค่ะ คุณสามารถใช้ข้อเสนอพิเศษนี้ได้ที่ [วิธีการรับข้อเสนอ เช่น การติดต่อเจ้าหน้าที่ฝ่ายขายที่เบอร์โทรศัพท์ หรือการซื้อผ่านเว็บไซต์ของเรา] โดยโปรโมชั่นจะหมดเขตในวันที่ [วันหมดเขต]

หากคุณมีคำถามหรือข้อสงสัยเพิ่มเติมเกี่ยวกับโปรโมชั่นหรือสินค้าของเรา ทีมงานของเรายินดีที่จะช่วยเหลือและให้ข้อมูลที่คุณต้องการค่ะ

ขอบคุณอีกครั้งที่ให้ความสนใจในสินค้าของเรา และเราหวังว่าจะได้ให้บริการคุณในเร็วๆ นี้ค่ะ

ขอแสดงความนับถือ [ชื่อของคุณ] [ตำแหน่ง] [ข้อมูลติดต่อ]


หากต้องการปรับเปลี่ยนรายละเอียดเพิ่มเติมหรือเน้นเรื่องใดเป็นพิเศษ แจ้งให้ฉันทราบได้นะคะ

Key Lessons Learned

  1. Examples are Powerful for AI Training

  2. Samples show AIs how it should handle your request.

  3. Samples are perfect for transferring style/tone/voice of your brand to AI.

Collect Samples for Your Team

Maintaining a library of relevant examples can be incredibly valuable for teams that frequently engage in similar tasks or content creation processes. By curating and reusing successful examples, teams can streamline their prompt engineering efforts and ensure consistent, high-quality outputs from language models like ChatGPT.

Here are examples of how each team might use this idea:

  1. Marketing team: gather samples of successful blog posts, social media captions, product descriptions, or ads campaigns

  2. Technical team: examples of well-structured API documentation, code snippets, or user manuals.

  3. Human Resources: maintain a library of well-crafted job descriptions, employee training course descriptions, employee onboarding materials.

ChatGPT