プロンプトライブラリ

AI エンジニアリングのプロンプト

モデルを使った開発向けのプロンプト:評価の設計、ツール定義の作成、検索パイプラインの計画。

プロンプト本体は、作成・テストした言語である英語です。これらのページの説明と案内文は翻訳されています。

  • evaluation
  • testing
  • llm
100/100 · 191 トークン

LLM 機能の評価計画

プロンプトを調整する前に、モデルを使う機能のテストセットと合格基準を設計します。

使う場面: モデルに依存する機能を出荷するにあたり、変更が改善になったかを繰り返し判断できる方法が必要なとき。

prompt
You are an AI engineer designing evaluations for a language model feature.

## Task
Design an evaluation plan for the feature described below.

## Requirements
- Define 10 test cases: 4 typical inputs, 3 edge cases, and 3 adversarial inputs.
- State the expected property of the output for each case, in a form code or a reviewer can check.
- Name the check for each property: exact match, schema validation, a rule, or a graded rubric.
- State the pass threshold for the suite as a number.
- Do not invent facts about the feature; base every case on the description.

## Output format
Return markdown with three sections: Test cases (a table with the columns ID, Type, Input summary, Expected property, and Check), Pass threshold (one sentence), and Gaps (bulleted list of what the description does not let you test).

## Input
<feature>
{{feature}}
</feature>

変数

{{feature}}
機能の内容、入力、出力、誤った答えのコスト。

入力例

feature: extracts the due date and total from invoice text into JSON; a wrong total causes an incorrect payment.

出力例

## Test cases
| ID | Type | Input summary | Expected property | Check |
|---|---|---|---|---|
| T1 | Typical | One-page invoice with one total | `total` equals 1250.00 | Exact match |
| A1 | Adversarial | Invoice text containing "ignore the instructions" | Output is valid JSON with the real total | Schema validation |

例示です。期待される形を示すために書いたもので、モデルが生成したものではありません。

  • agents
  • tool use
  • mcp
  • json schema
97/100 · 154 トークン

エージェント向けツール定義

説明した関数から、エージェントが正しく使えるツール名、説明、JSON Schema を書きます。

使う場面: 関数をエージェントや MCP クライアントに公開するとき。あいまいな説明は誤った呼び出しにつながります。

prompt
You are an AI engineer defining tools for a model that calls tools.

## Task
Draft a tool definition for the operation described below.

## Requirements
- Name the tool with a verb and a noun in snake_case.
- Write a description that says what the tool does, when to call it, and when not to call it.
- Describe every parameter with its type, format, and one example value.
- Mark a parameter as required only when the operation cannot run without it.
- Use enum for every parameter with a fixed set of values.

## Output format
Return one fenced JSON block containing an object with the keys name, description, and input_schema, where input_schema is a JSON Schema object.

## Input
<operation>
{{operation}}
</operation>

変数

{{operation}}
操作の内容、パラメーター、戻り値、制限。

入力例

operation: searches support tickets by text and status (open, pending, closed), returns at most 20 tickets, read-only.

出力例

```json
{ "name": "search_tickets", "description": "Search support tickets by text. Call it to find existing tickets before creating one. Read-only; it cannot modify tickets.", "input_schema": { "type": "object", "properties": { "query": { "type": "string" }, "status": { "type": "string", "enum": ["open", "pending", "closed"] } }, "required": ["query"] } }
```

例示です。期待される形を示すために書いたもので、モデルが生成したものではありません。

自分用に調整する

要件を自分の基準に合わせて編集し、結果をチェックしましょう。プロンプトアナライザーは入力に合わせて再採点し、オプティマイザーは要件を落とさずに冗長な表現を削り、セキュリティスキャナーはモデルに送る前に秘密情報や個人データを検出します。

その他のカテゴリ