返回提示庫

结构化输出

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.

參考來源