提示词库

AI 工程提示词

用于基于模型进行开发的提示词:设计评估、编写工具定义,以及规划检索流水线。

提示词是英文的,即它们的编写和测试所用的语言。这些页面上的说明和指引已翻译。

  • evaluation
  • testing
  • llm
100/100 · 191 token

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 token

智能体的工具定义

根据你描述的函数,编写智能体能正确使用的工具名称、描述和 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"] } }
```

仅为示意:为展示预期的形式而编写,并非由模型生成。

改成你的

修改需求以符合你的标准,然后检查结果。提示词分析器会在你输入时重新评分,优化器会在不丢失任何需求的前提下去掉冗词,安全扫描器会在你发送给模型之前标出密钥和个人数据。

更多类别