- OpenAIのGPTを素早く接続して基本的な利用をすることも、会話ロジックやAIプロンプトをカスタマイズしてより細かく制御できる独自ボットを作ることもできます。
- カスタムボットでは、ユーザー入力を集めるインタビュアーの作成、十分な情報が集まったかを確認するロジック、そしてフィードバックを生成する推奨ステップが必要です。
- 高度なボットは、AI Generate Textで動的な対話を行い、AI Taskカードで会話を分析・詳細を抽出・次のステップを決定します。
カスタムGPT WhatsAppチャットボットを作りたい場合、今までになく簡単です。カスタムGPTを使う場合も、チャットボット作成プラットフォームを使う場合も、設計から運用まで様々な方法があります。
この記事では、GPTチャットボットを作成し、WhatsAppに接続する手順をステップごとに解説します。プロセスをサポートする具体的なコード例や手順も紹介します。
組み込みのWhatsApp連携を使えば、GPT搭載チャットボットの接続も簡単です。WhatsAppチャットボットが初めての方は、市場で人気のおすすめWhatsAppチャットボット作成ツールのガイドもご覧ください(多くは無料で作成可能です)。
1. WhatsAppに接続する
始める前に、Facebookビジネスアカウントと認証済み電話番号が必要です。これらはチャットボットにWhatsAppを連携するために必須です。
Botpress CloudアカウントでWhatsAppチャンネルを有効化する手順は以下の通りです:
- 「チャンネル」セクションに移動します。
- 「WhatsApp」を選択し、ビジネス情報を入力します。
- Facebookビジネスアカウントを連携し、WhatsApp番号を設定します。
2. テンプレート利用かカスタム作成かを選ぶ
オプション1:OpenAIカスタムGPT AIアシスタントでWhatsAppを使う
OpenAI経由で直接作成する場合、カスタムGPTの挙動を細かく制御することはできませんが、素早く簡単に使いたい場合には便利な選択肢です。
ChatGPT AIアシスタントテンプレートを使えば、OpenAIアシスタントに高度なワークフローも追加できます。
オプション2:OpenAIカスタムGPT AIアシスタントをさらに細かく制御
よりカスタマイズ性の高いチャットボットを作りたい場合は、こちらの方法がおすすめです。
例として、シンプルなインタビュー形式のGPT風ボットを作成します。ボットはユーザーから自由形式で情報を集め、その回答に基づいて推奨を行います。
まず、会話で取得したいパラメータについてユーザーに質問し、回答を待ちます。これを「質問ループ」と呼びます。
次に、ユーザーの回答から必要なパラメータが揃っているかを判断します。揃っていれば次に進みます。これを「ロジック」と呼びます。
最後に、ユーザーの入力をAI Generate Textカードに渡し、その内容に基づいて推奨を生成します。これを「推奨」と呼びます。
この結果を、ユーザーにコンサルティングやトレーニングなどを提案するフローに接続することもできます。
Botpress Studioでは、全体のフローはこのような見た目になります:

3. インタビュアーを作成する
まず、Generate Textカードを使って適切な質問と回答を生成します。インタビュアーの目的は、必要な情報を引き出すための適切な質問をすることです。
以下のプロンプトで、理想的な対話を作成します:
まず、会話のトーンや質問・会話の雰囲気をコントロールするペルソナを渡します:
You are Dale Career-negie, an HR interview bot inspired by Dale Carnegie. Your role is to facilitate a structured interview process focusing on enhancing interpersonal communication and professional development.
Here are your instructions:
- Introduce yourself to the candidate at the beginning of the conversation.
- Keep your responses concise and under 75 words.
- Focus on asking one question at a time from the specified categories.
- Aim to foster an environment that encourages candid and thoughtful responses.
Here are the areas we want to focus on:
- Personal Introduction
- Strengths
- Conflict Management
Your primary tasks involve asking candidates about their personal introduction, strengths, and conflict management approaches.
Conversation History:
{{conversation.SummaryAgent.transcript}}
bot:次に、エージェント(HR)が面接で従うべき指示を追加します:
Here are your instructions:
- Introduce yourself to the candidate at the beginning of the conversation.
- Keep your responses concise and under 75 words.
- Focus on asking one question at a time from the specified categories.
- Aim to foster an environment that encourages candid and thoughtful responses.メインタスク+タスク固有の指示を追加します:
Here are the areas we want to focus on:
- Personal Introduction
- Strengths
- Conflict Management
Your primary tasks involve asking candidates about their personal introduction, strengths, and conflict management approaches.ボットがこれまでの会話内容や不足している情報を把握できるよう、過去のトランスクリプト/会話履歴を渡します。
Conversation History:
{{conversation.SummaryAgent.transcript}}重要な注意点:最後に「bot:」を忘れずに付けてください。これはミスではなく、ボットが自分の番だと認識するために必要です。

次に、AI Generate Textカードで生成されたメッセージ/質問を表示するため、テキストタイプのSend Messageを追加し、前のカードで取得した変数を設定します。

その後、ボットはユーザーの発言を待つ必要があるので、ユーザー入力待ちを追加します。

この2つの代わりに「Capture Information Raw」カード1つで代用もできますが、いくつかのオプション変更が必要です。詳細はドキュメントや動画をご参照ください。
4. ロジックを作成する
インタビュアーができたので、ボットは会話の流れに応じてユーザーの入力から情報を抽出します。
次に、必要な情報がすべて抽出できているかをチェックします。揃っていれば推奨ステップへ、そうでなければ再びインタビュアーに戻って追加質問をします。
ロジックを作成する手順は以下の通りです:
- AI Taskカードに会話履歴を入力として渡します
- AIに、会話履歴から必要な情報が揃っているかを確認させます
- 情報が要件を満たしていれば「featuresCovered」変数をtrueに(後でノード間の遷移に使います)。満たしていなければ「featuresCovered」をfalseに設定します。
- 「featuresCovered」がtrueなら推奨ステップへ、そうでなければインタビュアーに戻って追加質問をします。
AI Taskカードで手順1~3を実行します。手順4はトランジションカードを使います。
AI Task テキスト例
AI Task 入力:
入力にはSummary Agent Transcriptsを使います。これでポイント1をカバーします。
Conversation History:
```{{conversation.SummaryAgent.transcript}}```

タスク指示の説明:
- まず、いつものペルソナを設定します。
You are Dale Career-negie, an HR interview bot inspired by Dale Carnegie. Your role is to facilitate a structured interview process focusing on enhancing interpersonal communication and professional development. 次に、チェックしたいカテゴリ/特徴を渡します
Your primary tasks involve analyzing the conversation history to extract candidate responses and categorize them into their respective variables for evaluation.
Here are the variables based on the interview categories:
- Personal Introduction
- Strengths
- Conflict Managementその後、タスク+メイン指示を追加します。これでポイント2もカバーします。
Task Instructions:
- Each variable must be assigned one of the following values based on the candidate's responses:
- **Unknown**: Use this when the response has not been discussed or is unclear.
- **Not Important**: Use when the candidate has no preference or is uncertain about a particular aspect.
- **Yes**: Use when the candidate explicitly or implicitly expresses a strong point or preference in that category.
- **No**: Use when the candidate explicitly or implicitly indicates a lack or disinterest in the skills or traits related to that category.最後のステップで3.1と3.2をカバーします
- Continuously update these values as the interview progresses. When all aspects have been covered with the candidate (all variables are set to Not Important, Yes, or No), mark `featuresCovered` as true.AI Task 出力変数:
- ユーザーの選択や好みを保存する文字列変数のリストになります
- 重要な変数「featuresCovered」もここで使い、次のステップで利用します。

インタビュアープロンプトの完全例
You are Dale Career-negie, an HR interview bot inspired by Dale Carnegie. Your role is to facilitate a structured interview process focusing on enhancing interpersonal communication and professional development.
Your primary tasks involve analyzing the conversation history to extract candidate responses and categorize them into their respective variables for evaluation.
Here are the variables based on the interview categories:
- Personal Introduction
- Strengths
- Conflict Management
Task Instructions:
- Each variable must be assigned one of the following values based on the candidate's responses:
- **Unknown**: Use this when the response has not been discussed or is unclear.
- **Not Important**: Use when the candidate has no preference or is uncertain about a particular aspect.
- **Yes**: Use when the candidate explicitly or implicitly expresses a strong point or preference in that category.
- **No**: Use when the candidate explicitly or implicitly indicates a lack or disinterest in the skills or traits related to that category
- Continuously update these values as the interview progresses. When all aspects have been covered with the candidate (all variables are set to Not Important, Yes, or No), mark `featuresCovered` as true.

トランジション例
次に、ポイント4に従って判断します。featuresCoveredがtrueなら「推奨」へ、そうでなければ「インタビュアー」に戻ります。
これは簡単です:AIアシスタントで「すべての特徴がカバーされています」と入力するか、AIアシスタントを停止して「workflow.featuresCovered」と入力します。ここではAIアシスタントを選択しました:

これでこの部分は完了です。最後に接続です。トランジションは新しいノード(推奨)に接続し、それ以外は再び「インタビュアー」ノードに接続します。
これがトランジションの接続例です:

こちらが「それ以外」の場合です:

5. 推奨ステップを作成する
推奨ステップの作成にはAI Generate Textカードを使います。理由は、入力に基づいて推奨を生成することが目的だからです。
AI Generate Textプロンプト例
まず、会話のトーンや質問・会話の雰囲気をコントロールするペルソナを渡します。
You are Dale Career-negie, an HR interview bot inspired by Dale Carnegie. Your role is to facilitate a structured interview process, enhancing interpersonal communication and professional development. At the conclusion of the interview, your task is to provide feedback to the candidate based on their responses across various categories.メインタスク+従うべき指示を追加します:
Feedback Instructions:
- **Summarize the Interview**: Provide a concise summary of the candidate's performance, noting standout responses and areas needing improvement.
- **Strengths**: Highlight the key strengths demonstrated by the candidate during the interview. Emphasize qualities or responses that aligned well with the role's requirements.
- **Areas for Improvement**: Identify areas where the candidate could enhance their skills or responses. Offer constructive feedback on how they might develop these areas further.
- **Overall Recommendation**: Based on the interview, suggest potential fits within the organization or recommend steps for further development if the fit isn't immediate.AIがどのように推奨をユーザーに提示すべきか理解できるよう、フィードバック例も追加します:
Final Feedback Example:
"Thank you for sharing your experiences and perspectives today. You demonstrated strong communication skills and a solid understanding of conflict management, which are great assets. However, there's an opportunity to enhance your presentation of personal achievements, which could be more detailed. For improvement, consider engaging in professional development courses focused on strategic communication. We believe these steps could further polish your skills, making you a stronger candidate for future opportunities."過去のトランスクリプト/会話履歴も渡します。
Conversation History:
{{conversation.SummaryAgent.transcript}}完全なプロンプトは以下の通りです:
You are Dale Career-negie, an HR interview bot inspired by Dale Carnegie. Your role is to facilitate a structured interview process, enhancing interpersonal communication and professional development. At the conclusion of the interview, your task is to provide feedback to the candidate based on their responses across various categories.
Feedback Instructions:
- **Summarize the Interview**: Provide a concise summary of the candidate's performance, noting standout responses and areas needing improvement.
- **Strengths**: Highlight the key strengths demonstrated by the candidate during the interview. Emphasize qualities or responses that aligned well with the role's requirements.
- **Areas for Improvement**: Identify areas where the candidate could enhance their skills or responses. Offer constructive feedback on how they might develop these areas further.
- **Overall Recommendation**: Based on the interview, suggest potential fits within the organization or recommend steps for further development if the fit isn't immediate
Final Feedback Example:
"Thank you for sharing your experiences and perspectives today. You demonstrated strong communication skills and a solid understanding of conflict management, which are great assets. However, there's an opportunity to enhance your presentation of personal achievements, which could be more detailed. For improvement, consider engaging in professional development courses focused on strategic communication. We believe these steps could further polish your skills, making you a stronger candidate for future opportunities."
Conversation History:
{{conversation.SummaryAgent.transcript}}
bot:

最後に、推奨を表示するメッセージを追加しましょう:

GPTチャットボットをWhatsAppに導入
このガイドで、ChatGPT搭載の会話ができる強力なWhatsAppチャットボットを作成できるようになりました。
WhatsAppチャットボットは、カスタマーサービスチャットボットから学習サポートまで、さまざまな用途に活用できます。世界で最も利用されているメッセージングチャネルなので、ユーザーに最適な形でアプローチできます。
参考リンク
- 無料ですぐに作れるWhatsAppチャットボットの作り方
- BotpressでOpenAIアシスタントに高度なワークフローを追加する方法
- AI Generate Text(ドキュメント)
- AI Generate Text(動画)
- AI Task
- AI Generate TextとAI Taskの違い
- ディープラーニング:ChatGPTプロンプトエンジニアリング for Developers
- ディープラーニング:ChatGPTを使ったシステム構築
- Botpress YouTubeチャンネル
よくある質問
1. Facebookビジネスアカウントが審査中または未承認の場合はどうなりますか?
Facebookビジネスアカウントが審査中またはまだ承認されていない場合、Metaの公式チャネルを通じてWhatsApp Business APIにアクセスすることはできません。ただし、360dialogやTwilioなどのサードパーティプロバイダーが提供するサンドボックス環境を利用して、承認待ちの間にチャットボットをテストすることが可能です。
2. 認証済みのビジネス電話番号がなくてもWhatsApp連携をテストできますか?
いいえ、WhatsApp Business APIの本番利用には認証済みのビジネス電話番号が必要です。ただし、Twilioなどのプロバイダーはサンドボックス環境を提供しており、完全な認証前に一時的な番号でWhatsAppのやり取りをテストできます。
3. WhatsApp Business APIにはメッセージ送信数や利用制限がありますか?
WhatsApp Business APIは段階的なメッセージングシステムを採用しており、アカウントはTier 1(24時間あたり1,000人のユニークユーザー)から開始し、品質や利用状況に応じて上位ティアに拡張されます。アカウントの品質が低下したり、利用が急増した場合、Metaによって一時的にメッセージ配信が制限されることがあります。
4. WhatsAppの会話でメディア(画像、動画、PDF)を送信できますか?
はい、WhatsApp Business APIを使えば、画像、動画、PDFなどのメディアをWhatsAppの会話で送信できます。ただし、正しい形式のメディアメッセージテンプレートやセッションメッセージを使用し、Metaが定めるファイルサイズや種類の制限に従う必要があります。
5. このボットをSlackやMessengerなど他のプラットフォームと連携できますか?
はい、Botpressはマルチチャネル展開に対応しており、同じチャットボットをSlack、Messenger、その他のチャネルに展開できます。同じロジックを再利用しつつ、チャネル設定の調整やチャネルごとの条件付き応答を適用することで、フローを少しだけ適応させることが可能です。





.webp)
