Nhắc lệnh nhập vai cho chatbot

Kỹ thuật Prompt với OpenAI API

Fouad Trad

Machine Learning Engineer

Nhắc lệnh nhập vai

  • Bảo chatbot đóng vai trò cụ thể
  • Chatbot -> diễn viên trên sân khấu
  • Chatbot điều chỉnh theo vai
  • Ngôn ngữ/nội dung phù hợp persona
  • Tương tác hiệu quả hơn

 

Hình ảnh nhiều mặt nạ và cải trang thể hiện nhập vai.

Kỹ thuật Prompt với OpenAI API

Ví dụ nhập vai

Câu hỏi: Bạn có thể cung cấp thông số kỹ thuật của Sản phẩm X mà công ty bạn cung cấp không?

Hình ảnh người dùng và ba người, mỗi người đại diện cho một vai (hỗ trợ khách hàng, quản lý dự án, và kỹ sư bán hàng)

Kỹ thuật Prompt với OpenAI API

Ví dụ nhập vai

Câu hỏi: Bạn có thể cung cấp thông số kỹ thuật của Sản phẩm X mà công ty bạn cung cấp không?

Hình ảnh người dùng và ba người, mỗi người đại diện cho một vai (hỗ trợ khách hàng, quản lý dự án, và kỹ sư bán hàng)

Kỹ thuật Prompt với OpenAI API

Ví dụ nhập vai

Câu hỏi: Bạn có thể cung cấp thông số kỹ thuật của Sản phẩm X mà công ty bạn cung cấp không?

Hình ảnh người dùng và ba người, mỗi người đại diện cho một vai (hỗ trợ khách hàng, quản lý dự án, và kỹ sư bán hàng)

Kỹ thuật Prompt với OpenAI API

Nhân viên hỗ trợ khách hàng

Hình ảnh một nhân viên hỗ trợ khách hàng.

  • Cung cấp hướng dẫn
  • Hướng khách đến website
  • Đề nghị hỗ trợ
Kỹ thuật Prompt với OpenAI API

Quản lý sản phẩm

  • Nêu bật lợi ích chiến lược
  • Tập trung vào phù hợp sản phẩm

Hình ảnh một quản lý sản phẩm.

Kỹ thuật Prompt với OpenAI API

Kỹ sư bán hàng

  • Tập trung thông số kỹ thuật
    • Bộ xử lý
    • Tính năng
    • Bảo mật

Hình ảnh một kỹ sư bán hàng.

Kỹ thuật Prompt với OpenAI API

Nhắc lệnh nhập vai

  • Yêu cầu mô hình đóng vai một vai trò cụ thể
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))
Kỹ thuật Prompt với OpenAI API

Chuyên gia phân tích tài chính

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.
Kỹ thuật Prompt với OpenAI API

Nhập vai hiệu quả hơn

  • Yêu cầu chi tiết trong vai trò
  • Thêm đặc điểm như tính cách và chuyên môn
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))
Kỹ thuật Prompt với OpenAI API

Nhà báo công nghệ

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 [...]
Kỹ thuật Prompt với OpenAI API

Nhập vai kèm yêu cầu

  • Có thể quy định hướng dẫn phản hồi và hành vi trong nhắc lệnh nhập vai
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."






Kỹ thuật Prompt với OpenAI API

Nhập vai kèm yêu cầu

  • Có thể quy định hướng dẫn phản hồi và hành vi trong nhắc lệnh nhập vai.
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.
Kỹ thuật Prompt với OpenAI API

Ayo berlatih!

Kỹ thuật Prompt với OpenAI API

Preparing Video For Download...