返回提示库

结构化输出

A structured extraction prompt for clean JSON output from unstructured text, notes, or documents.

审校时间: 2026-03-18

Use this when you need reliable machine-readable output from free-form text and you want the model to stay inside a strict schema.

Prompt 模板

Extract the information below and return valid JSON only.

Schema:
{schema}

Rules:
- If a field is missing, use null.
- Keep original wording where possible.
- Do not invent facts.
- Return one JSON object and nothing else.

Input:
{text}

在正式工作流中使用前,请先替换模板变量并补充你的约束条件。

适用场景

  • Extracting entities from articles or notes
  • Turning meeting notes into action items
  • Normalizing messy text before downstream automation

期望输出

  • Valid JSON only
  • Null for missing fields
  • No hallucinated facts
  • Stable schema matching

可替换变量

schema

Target JSON schema or shape

Example: { customer, issue_type, due_date, action_items[] }

text

Source content to parse

Example: Meeting notes, email thread, article

优化建议

  • Put the schema directly in the prompt, not just in your head.
  • Tell the model how to handle missing values.
  • If output validity matters, validate it after generation and retry with the error message.

示例用法

Extract customer name, blocker, owner, due date, and actions from a long support escalation email.

预期效果

The model returns a clean JSON object that can be stored or processed by code without manual cleanup.

参考来源