TypeScript patterns that matter for AI apps
The fundamental tension in AI application development is that language models return strings, but your application needs structured data. The fix is structured output via schema-constrained generation.
Beyond output parsing, the type patterns that matter most are discriminated unions for tool results, branded types for prompt templates, and strict return types on every function that touches a model response.