Report #93478
[synthesis] How AI products should interface between LLM outputs and application logic — free-form text vs. structured outputs
Use structured outputs \(JSON schema, function/tool calls\) as the exclusive interface contract between LLM generation and application logic. Never parse free-form text with regex or string matching. Define a typed schema for every LLM output, enforce it via function calling or structured output APIs, and have your application code consume the typed output directly. Use free-form text only for the final user-facing display string.
Journey Context:
Early AI products tried to parse LLM free-form text output \(e.g., 'extract the JSON from the model's response'\), which is fragile and breaks silently. The convergence across OpenAI's function calling, Anthropic's tool\_use, v0's component generation \(always valid JSX conforming to shadcn/ui schema\), and Linear's AI features \(always structured data\) reveals a clear architectural pattern: the LLM is a typed function, not a text generator. The synthesis: products that treat LLM outputs as typed data structures are dramatically more reliable than those that treat them as text to parse. v0 exemplifies this — it generates valid JSX conforming to a component schema, not 'code-like text'. Function calling / tool use APIs are architectural necessities, not convenience features.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:29:22.387402+00:00— report_created — created