プロンプトの追加

最終更新: 2025年3月26日
プロンプトの追加

さまざまなプロンプトモードにより、ユーザーは経験レベルに応じてさまざまな方法でプロンプトを追加することができる。

Prompt Lab では、以下の編集モードが利用可能です:

  • フリーフォーム :入力されたプロンプトをそのままプレーンテキストとしてモデルに送信することができます。 高度なプロンプトエンジニアリングに精通した経験豊富なユーザーに最適。
  • 構造化 :ユーザーは、ラベル付けされたフィールドにテキストを追加して、書式を設定し、モデルにプロンプトを送信することができます。 これからプロンプト・エンジニアリングを始める初心者に最適。
  • チャット :ユーザーがモデルと対話することで、モデルが対話や質問応答タスクをどのように処理するかを確認することができます。

以下のサンプルでは、自由形式モードと構造化モードでプロンプトを追加する方法を示します。 チャットモードの使い方については、 Prompt Lab のチャットモードを参照してください。

few-shotプロンプトサンプルメッセージを分類する

シナリオクラウドソフトウェア会社のカスタマーサポートチャットボットに送信されたメッセージがある場合、顧客のメッセージを質問か問題の説明のどちらかに分類する。 クラスタイプに基づいて、チャットは適切なサポートチームにルーティングすることができます。

分類作業に適したモデルを選択する。 詳細は「 モデルの選択 」を参照。

モデル パラメータ

  • Decoding : Greedyに設定。 モデルは指定されたクラス名のいずれかを返さなければならない。 モデルはクリエイティブで新しいクラスを作ることはできない。
  • 停止基準 :2つの停止シーケンスを指定する:「質問」と「問題」。 モデルが入力をいずれかのカテゴリーに分類したら、停止する。 出力が短いので、 Max tokens パラメーターは 5 に設定できる。

フリーフォーム・モード

プロンプト・テキスト

このfew-shotプロンプト、 Prompt Lab のフリーフォームプロンプトエディタに貼り付け、モデルを選択し、パラメータを設定し、 Generateをクリックすると結果が表示されます。

Message: When I try to log in, I get an error.
Class name: Problem

Message: Where can I find the plan prices?
Class name: Question

Message: What is the difference between trial and paygo?
Class name: Question

Message: The registration page crashed, and now I can't create a new account.
Class name: Problem

Message: What regions are supported?
Class name: Question

Message: I can't remember my password.
Class name: Problem

Message: I'm having trouble registering for a new account.

構造化モード

セットアップセクション

これらのヘッダーと例を、 Set up セクションの Examples エリアに貼り付けます:

表 2. クラス分け数ショットの例
メッセージ: クラス名:
When I try to log in, I get an error. Problem
Where can I find the plan prices? Question
What is the difference between trial and paygo? Question
The registration page crashed, and now I can't create a new account. Problem
What regions are supported? Question
I can't remember my password. Problem

セクションを試す

このメッセージを Try セクションに貼り付ける:

I'm having trouble registering for a new account.

モデルを選択してパラメータを設定し、 Generateをクリックして結果を見る。

few-shotプロンプト使ったサンプル会議の記録を要約する

シナリオ会議の記録がある場合、要点だけをメモとしてまとめ、そのメモを会議に出席していないチームメイトと共有できるようにする。

要約作業に適したモデルを選択する。 詳細は「 モデルの選択 」を参照。

モデル パラメータ

  • デコードGreedy に設定。 このモデルは、プロンプトの内容に基づいて最も予測可能なコンテンツを返さなければならない。
  • 停止基準 :サマリーの後にモデルがテキスト生成を停止するようにするには、2つの改行文字の停止シーケンスを指定します。 そのためには、 Stop sequence テキストボックスをクリックし、Enterキーを2回押してから、 Add sequenceをクリックする。 Max tokensパラメータを 60に設定する。

フリーフォーム・モード

プロンプト・テキスト

このfew-shotプロンプト、 Prompt Lab のフリーフォームプロンプトエディタに貼り付け、モデルを選択し、パラメータを設定し、 Generateをクリックすると結果が表示されます。

Transcript:
00:00   [sam]   I wanted to share an update on project X today.
00:15   [sam]   Project X will be completed at the end of the week.
00:30   [erin]  That's great!
00:35   [erin]  I heard from customer Y today, and they agreed to buy our product.
00:45   [alex]  Customer Z said they will too.
01:05   [sam]   Great news, all around.
Summary:
Sam shared an update that project X will be complete at the end of the week. 
Erin said customer Y will buy our product. And Alex said customer Z will buy 
our product too.

Transcript:
00:00   [ali]   The goal today is to agree on a design solution.
00:12   [alex]  I think we should consider choice 1.
00:25   [ali]   I agree
00:40   [erin]  Choice 2 has the advantage that it will take less time.
01:03   [alex]  Actually, that's a good point.
01:30   [ali]   So, what should we do?
01:55   [alex]  I'm good with choice 2.
02:20   [erin]  Me too.
02:45   [ali]   Done!
Summary:
Alex suggested considering choice 1. Erin pointed out choice two will take 
less time. The team agreed with choice 2 for the design solution.

Transcript:
00:00   [alex]  Let's plan the team party!
00:10   [ali]   How about we go out for lunch at the restaurant?
00:21   [sam]   Good idea.
00:47   [sam]   Can we go to a movie too?
01:04   [alex]  Maybe golf?
01:15   [sam]   We could give people an option to do one or the other.
01:29   [alex]  I like this plan. Let's have a party!
Summary:

構造化モード

セットアップセクション

これらのヘッダーと例を、 Set up セクションの Examples エリアに貼り付けます:

表 4. 要約例
Transcript: Summary:
00:00 [sam] I wanted to share an update on project X today.
00:15   [sam]   Project X will be completed at the end of the week.
00:30   [erin]  That's great!
00:35   [erin]  I heard from customer Y today, and they agreed to buy our product.
00:45   [alex]  Customer Z said they will too.
01:05   [sam]  Great news, all around.
- Sam shared an update that project X will be complete at the end of the week
- Erin said customer Y will buy our product
- And Alex said customer Z will buy our product too
00:00   [ali]   The goal today is to agree on a design solution.
00:12   [alex]  I think we should consider choice 1.
00:25   [ali]   I agree
00:40   [erin]  Choice 2 has the advantage that it will take less time.
01:03   [alex]  Actually, that's a good point.
01:30   [ali]   So, what should we do?
01:55   [alex]  I'm good with choice 2.
02:20   [erin]  Me too.
02:45  [ali]   Done!
- Alex suggested considering choice 1
- Erin pointed out choice two will take less time
- The team agreed with choice 2 for the design solution

セクションを試す

このメッセージを Try セクションに貼り付ける:

00:00   [alex]  Let's plan the team party!
00:10   [ali]   How about we go out for lunch at the restaurant?
00:21   [sam]   Good idea.
00:47   [sam]   Can we go to a movie too?
01:04   [alex]  Maybe golf?
01:15   [sam]   We could give people an option to do one or the other.
01:29   [alex]  I like this plan. Let's have a party!

モデルを選択してパラメータを設定し、 Generateをクリックして結果を見る。

次のタスク

Prompt Lab でプロンプトの作成とテストが完了したら、その作業を資産保存できます。 詳細については、 プロンプトの保存を参照してください。

親トピック Prompt Lab