พรอมต์แบบสวมบทบาทสำหรับแชทบอต

Prompt Engineering กับ OpenAI API

Fouad Trad

Machine Learning Engineer

พรอมต์แบบสวมบทบาท

  • บอกให้แชทบอตรับบทบาทที่กำหนด
  • แชทบอต -> นักแสดงในบทละคร
  • แชทบอตปรับตัวให้เข้ากับบทบาท
  • ภาษาและเนื้อหาถูกปรับให้เหมาะกับตัวตนนั้น
  • การโต้ตอบมีประสิทธิภาพมากขึ้น

 

ภาพแสดงหน้ากากและการปลอมแปลงต่าง ๆ เพื่อสะท้อนถึงการสวมบทบาท

Prompt Engineering กับ OpenAI API

ตัวอย่างการสวมบทบาท

คำถาม: ช่วยให้ข้อมูลจำเพาะทางเทคนิคของ Product X ที่บริษัทของคุณเสนอได้ไหม

ภาพแสดงผู้ใช้และบุคคลสามคน แต่ละคนรับบทบาทที่แตกต่างกัน (ฝ่ายสนับสนุนลูกค้า ผู้จัดการโปรเจกต์ และวิศวกรฝ่ายขาย)

Prompt Engineering กับ OpenAI API

ตัวอย่างการสวมบทบาท

คำถาม: ช่วยให้ข้อมูลจำเพาะทางเทคนิคของ Product X ที่บริษัทของคุณเสนอได้ไหม

ภาพแสดงผู้ใช้และบุคคลสามคน แต่ละคนรับบทบาทที่แตกต่างกัน (ฝ่ายสนับสนุนลูกค้า ผู้จัดการโปรเจกต์ และวิศวกรฝ่ายขาย)

Prompt Engineering กับ OpenAI API

ตัวอย่างการสวมบทบาท

คำถาม: ช่วยให้ข้อมูลจำเพาะทางเทคนิคของ Product X ที่บริษัทของคุณเสนอได้ไหม

ภาพแสดงผู้ใช้และบุคคลสามคน แต่ละคนรับบทบาทที่แตกต่างกัน (ฝ่ายสนับสนุนลูกค้า ผู้จัดการโปรเจกต์ และวิศวกรฝ่ายขาย)

Prompt Engineering กับ OpenAI API

เจ้าหน้าที่ฝ่ายสนับสนุนลูกค้า

ภาพแสดงเจ้าหน้าที่ฝ่ายสนับสนุนลูกค้า

  • ให้คำแนะนำ
  • แนะนำลูกค้าไปยังเว็บไซต์
  • เสนอความช่วยเหลือ
Prompt Engineering กับ OpenAI API

ผู้จัดการผลิตภัณฑ์

  • เน้นประโยชน์เชิงกลยุทธ์
  • มุ่งเน้นความสอดคล้องกับผลิตภัณฑ์

ภาพแสดงผู้จัดการผลิตภัณฑ์

Prompt Engineering กับ OpenAI API

วิศวกรฝ่ายขาย

  • เน้นรายละเอียดทางเทคนิค
    • โปรเซสเซอร์
    • คุณสมบัติ
    • ความปลอดภัย

ภาพแสดงวิศวกรฝ่ายขาย

Prompt Engineering กับ OpenAI API

พรอมต์แบบสวมบทบาท

  • บอกให้โมเดล รับบทบาท ที่เฉพาะเจาะจง
system_prompt = "Act as an expert financial analyst."

user_prompt = "Offer insights into retirement planning for individuals approaching retirement age." print(get_response(system_response, user_response))
Prompt Engineering กับ OpenAI API

นักวิเคราะห์การเงินผู้เชี่ยวชาญ

Proper retirement planning is crucial to ensure a comfortable and financially stable retirement. Here are some key
considerations:

- Evaluate Your Financial Position: Begin by assessing your current financial situation [...]
- Set Retirement Goals: Determine your retirement goals and lifestyle preferences [...]
- Estimate Retirement Expenses: Project your retirement expenses by categorizing them into essential [...]
[...]

Remember, retirement planning is a complex process, and everyone's situation is unique. 
It's advisable to work with a certified financial planner who can provide personalized advice based on 
your individual needs and goals.
Prompt Engineering กับ OpenAI API

การสวมบทบาทที่มีประสิทธิภาพมากขึ้น

  • กำหนดข้อกำหนดเฉพาะภายในบทบาท
  • เพิ่มลักษณะนิสัยและความเชี่ยวชาญเข้าไปด้วย
system_prompt = "Act as a seasoned technology journalist covering the latest trends 
in the tech industry. You're known for your thorough research and insightful analysis."

user_prompt = "What is the impact of artificial intelligence on job markets?" print(get_response(system_response, user_response))
Prompt Engineering กับ OpenAI API

นักข่าวสายเทคโนโลยี

Title: "Navigating the New Normal: How Artificial Intelligence is Reshaping Job Markets"

As the technological landscape continues to evolve at an unprecedented pace, one of the most 
significant transformations we're witnessing is the integration of Artificial Intelligence 
(AI) into various industries [...].

While AI's potential to streamline processes [...]. Let's explore the multifaceted impact 
of AI on employment...

1. Automation and Job Displacement: [...]
2. Augmentation and Enhanced Creativity: [...]
[...]

In conclusion, the impact of AI on job markets is undeniable, reshaping traditional roles 
and paving the way for novel opportunities [...]
Prompt Engineering กับ OpenAI API

การสวมบทบาทพร้อมเงื่อนไข

  • สามารถระบุแนวทางการตอบสนองและพฤติกรรมในพรอมต์แบบสวมบทบาทได้
system_prompt = "Act as a seasoned technology journalist covering the latest trends 
in the tech industry. You're known for your in-depth research and insightful analysis."






Prompt Engineering กับ OpenAI API

การสวมบทบาทพร้อมเงื่อนไข

  • สามารถระบุแนวทางการตอบสนองและพฤติกรรมในพรอมต์แบบสวมบทบาทได้
system_prompt = "Act as a seasoned technology journalist covering the latest trends 
in the tech industry. You're known for your in-depth research and insightful analysis.
If the question is related to tech, you answer to the best of your knowledge.
Otherwise, you just respond with 'I am trained to only discuss technology topics."

user_prompt = "Which American literature books do you recommend?" print(get_response(system_prompt, user_prompt))
I am trained to only discuss technology topics.
Prompt Engineering กับ OpenAI API

มาฝึกกันเถอะ!

Prompt Engineering กับ OpenAI API

Preparing Video For Download...