renderOutputSchema function exported ✓ 100.0%

Last updated: 2026-03-01T23:25:47.071Z

Metrics

LOC: 12 Complexity: 3 Params: 2 Coverage: 100.0% (5/5 lines, 20x executed)

Signature

renderOutputSchema( fields: readonly PromptOutputField[], ): : string

Summary

Renders output schema fields as a compact JSON format spec. renderOutputSchema([ { name: "fieldType", type: "string", description: "semantic type" }, { name: "confidence", type: "number", description: "0.0–1.0", range: { min: 0, max: 1 } }, ]) // → '{"fieldType": , "confidence": <number: 0.0–1.0>}'

Tags

#@example

Source Code

export function renderOutputSchema(
  fields: readonly PromptOutputField[],
): string {
  const entries = fields.map((f) => {
    if (f.type === "number" && f.range) {
      return `"${f.name}": <${f.type}: ${f.range.min}–${f.range.max}>`;
    }
    return `"${f.name}": <${f.type}>`;
  });

  return `{${entries.join(", ")}}`;
}

Dependencies (Outgoing)

graph LR renderOutputSchema["renderOutputSchema"] PromptOutputField["PromptOutputField"] PromptExample["PromptExample"] StructuredPrompt["StructuredPrompt"] renderOutputSchema -->|uses| PromptOutputField renderOutputSchema -->|uses| PromptExample renderOutputSchema -->|uses| StructuredPrompt style renderOutputSchema fill:#dbeafe,stroke:#2563eb,stroke-width:2px click renderOutputSchema "a94ee40c258cb1af.html" click PromptOutputField "a24a06f1b274d092.html" click PromptExample "1a94fb1b59e5d12f.html" click StructuredPrompt "a828ccf4d3eb7bb7.html"

Impact (Incoming)

graph LR renderOutputSchema["renderOutputSchema"] renderPromptBase["renderPromptBase"] makePrompt["makePrompt"] renderPromptBase -->|calls| renderOutputSchema makePrompt -->|uses| renderOutputSchema style renderOutputSchema fill:#dbeafe,stroke:#2563eb,stroke-width:2px click renderOutputSchema "a94ee40c258cb1af.html" click renderPromptBase "1d807d7283d93d7a.html" click makePrompt "ea0597fcfc9fdb16.html"
SourceType
renderPromptBase calls
makePrompt uses