メインコンテンツへスキップ
バージョン: 安定版 (v4.x)

プロンプティング

非公式ベータ版翻訳

このページは PageTurner AI で翻訳されました(ベータ版)。プロジェクト公式の承認はありません。 エラーを見つけましたか? 問題を報告 →

Ask AIから最適な結果を得るためのプロンプティング技術を習得しましょう。このガイドでは、DocSearch v4におけるプロンプトの仕組み、主要AIプロバイダーで実証済みのテクニック、ドキュメント向けの効果的でブランドに沿ったAI応答を作成する実践例を紹介します。

学習内容:

  • Ask AIがコンテンツと連携してプロンプトを活用する方法

  • 実証済みプロンプティング技術とパターン

  • よくある落とし穴と回避策

  • セキュリティとコンプライアンスのベストプラクティス

1. Ask AIにおけるプロンプトの仕組み

  1. 基本システムプロンプト(非表示) - すべてのAsk AIリクエストは、安全性・検索機能・トーンを強制する独自システムプロンプトから始まります。

  2. 補完システムプロンプト - ユーザーが追加する短い指示(例:「Kubernetes SREのように回答し、簡潔な箇条書きを優先」)。

  3. ユーザークエリ - 訪問者がチャットボックスに入力する質問。

  4. コンテキストパッセージ - Algoliaインデックスから自動挿入される関連コンテンツ。

ステップ2のみがユーザー制御可能で、他はAsk AIが処理します。プロンプトは完全な書き換えではなくポリシーオーバーレイと捉えましょう。


2. 効果的なプロンプトの原則

GoalWhat to doWhy it helps
Be explicitState role, style and constraints in the first sentence.LLMs obey the earliest, clearest instruction.
Ground in contextAdd product names, audience level, or domain jargon.Reduces hallucinations and keeps answers on-brand.
Set format"Answer in Markdown with H2 headings and a summary table." (we handled this for you)Ensures consistent rendering in your site theme.
Show, don't tellGive one or two short exemplars of the desired output.Few-shot examples outperform general adjectives.
Limit scope"If you're unsure, say I don't know."Encourages honesty over speculation.
Iterate & testLook at the feedback, tweak, re-run.Prompting is an empirical craft - small wording changes matter.

ポイント - 簡潔さを保つ 過度に長いプロンプトは関連ドキュメントをコンテキストウィンドウから押し出し、応答を遅延させます。


3. 効果的なプロンプトパターン

スタイル転換

You are a senior React maintainer. Explain concepts in the style of React docs: concise intro ➜ "Example" ➜ "Gotchas".

ペルソナ+対象読者

Act as a cloud-native Solutions Architect.
Audience: junior DevOps engineers migrating to Kubernetes.
Goal: explain trade-offs in plain English, no jargon.

多段階推論

FIRST think step-by-step about possible causes.
THEN output only the final answer in bullet points.

4. よくある落とし穴

Anti-patternWhat happensFix
Vagueness - "Explain this."Generic or rambling answers.Specify role, topic, length.
Prompt stuffing - 1 000-word instructions.Context window overflow; higher cost.Trim to the essentials.
Conflicting rulesModel picks one at random.Merge rules or order them by priority.

5. セキュリティとコンプライアンス

  • プロンプトにシークレット、PII(個人識別情報)、内部URLを貼り付けないでください。

  • 会社のポリシーや機密情報をプロンプトで使用しないでください。

  • テスト時には生成された回答を数件チェックし、ポリシー準拠を確認してください。


6. 参考資料

  • OpenAI - プロンプトエンジニアリングのベストプラクティス (help.openai.com)

  • OpenAI Cookbook - GPT-4.1プロンプティングガイド (cookbook.openai.com)

  • Anthropic - Claude向けプロンプトエンジニアリング概要 (docs.anthropic.com)

これらの資料には、具体的なテンプレート、サンプルライブラリ、連鎖思考プロンプティングなどの高度な技術が含まれています。


簡易チェックリスト

  • 役割と対象読者を定義

  • 希望する回答形式を指定

  • サンプルを含む(2件以内)

  • 範囲制限とフォールバック言語を追加

  • 実際のユーザークエリでテスト

プロンプティングを楽しみましょう。覚えておいてください:試行→観察→改善!