agently-output-control

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Agently Output Control

Agently 输出控制

Use this skill when the question is what shape the model should return and how that shape should stay reliable.
The user does not need to say
.output(...)
or
ensure_keys
. Requests for stable JSON-like fields, structured reports, or machine-readable sections should route here.
当用户询问模型应返回何种格式,以及如何确保该格式的可靠性时,使用此技能。
用户无需提及
.output(...)
ensure_keys
。只要是对稳定类JSON字段、结构化报告或机器可读内容的请求,都应引导至此处。

Native-First Rules

原生优先规则

  • prefer
    .output(...)
    for machine-readable results
  • prefer
    ensure_keys
    when required fields must be enforced
  • keep output schema explicit when downstream systems, workflow branches, or later model steps consume the result
  • 若需要机器可读结果,优先使用
    .output(...)
  • 当必须强制包含必填字段时,优先使用
    ensure_keys
  • 当结果会被下游系统、工作流分支或后续模型步骤使用时,需明确输出 schema

Anti-Patterns

反模式

  • do not handwrite JSON post-processors when
    .output(...)
    already owns the contract
  • do not build custom retry loops for missing keys before checking
    ensure_keys
  • .output(...)
    已能保证输出规范时,请勿手动编写JSON后处理器
  • 在检查
    ensure_keys
    之前,请勿构建自定义重试循环来处理缺失键的问题

Read Next

接下来阅读

  • references/overview.md
  • references/overview.md