AI SDK 4.2
Mar 21, 2025

Summary
AI SDK 4.2 introduces support for reasoning models (e.g., Anthropic Sonnet 3.7, DeepSeek R1) with dedicated `reasoning` property or `extractReasoningMiddleware`. It adds Model Context Protocol (MCP) client support for integrating external tools via stdio or SSE. The `useChat` hook now handles message parts (text, source, reasoning, tool-invocation, file) to preserve output sequence. Image generation is supported via models like Gemini 2.0 Flash, accessible as `file` message parts. URL sources are standardized across providers (OpenAI, Google, Vertex, Perplexity) for attribution. OpenAI's new Responses API is supported with a simple model instantiation change. Updates include Svelte 5 support and middleware enhancements.