チャットボット向けロールプレイプロンプト

OpenAI API によるプロンプトエンジニアリング

Fouad Trad

Machine Learning Engineer

ロールプレイプロンプト

  • チャットボットに特定の役割を演じるよう指示する
  • チャットボット → 劇の中の役者
  • チャットボットは役割に合わせて振る舞いを調整する
  • ペルソナに合わせた言葉遣いと内容
  • より効果的なやり取り

Image showing various masks and disguises to reflect role-playing.

OpenAI API によるプロンプトエンジニアリング

ロールプレイの例

質問: 貴社が提供するProduct Xの技術仕様を教えていただけますか?

Image showing the user and three people, each representing a role (customer support, project manager, and sales engineer)

OpenAI API によるプロンプトエンジニアリング

ロールプレイの例

質問: 貴社が提供するProduct Xの技術仕様を教えていただけますか?Image showing the user and three people, each representing a role (customer support, project manager, and sales engineer)

OpenAI API によるプロンプトエンジニアリング

ロールプレイの例

質問: 貴社が提供するProduct Xの技術仕様を教えていただけますか?Image showing the user and three people, each representing a role (customer support, project manager, and sales engineer)

OpenAI API によるプロンプトエンジニアリング

カスタマーサポート担当者

Image showing a customer support agent.

  • 案内する
  • 顧客をウェブサイトに誘導する
  • サポートを提供する
OpenAI API によるプロンプトエンジニアリング

プロダクトマネージャー

  • 戦略的な利点を強調する
  • 製品との整合性に焦点を当てる

Image showing a product manager.

OpenAI API によるプロンプトエンジニアリング

セールスエンジニア

  • 技術的な詳細に焦点を当てる
    • プロセッサ
    • 機能
    • セキュリティ

Image showing a sales engineer.

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))
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.
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))
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 [...]
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."






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.
OpenAI API によるプロンプトエンジニアリング

練習しましょう!

OpenAI API によるプロンプトエンジニアリング

Preparing Video For Download...