@ai-sdk/perplexity@5.0.0
Vercel AI SDK's Perplexity provider updated to v5.0.0, introducing a breaking migration from the Sonar Chat Completions API to the Perplexity Agent API.
Why this signal matters
Version 5.0.0 of @ai-sdk/perplexity introduces a breaking change by migrating language generation from the Sonar Chat Completions API to the Agent API. This transition replaces Sonar model IDs and provider options with Agent API presets, models, and tools. Additionally, request and response metadata, raw stream events, and usage/cost data formats have changed. The new Agent API does not support Sonar PDF input or image and video results. Accompanying patch changes include: - Recovering missing text from Agent API terminal events and output items (including incomplete responses) without duplicating delta text, alongside tracking individual message content parts separately. - Accepting native Agent API tool traces (e.g., finance results) without validating them strictly as web search results, preserving them in raw responses and stream chunks. - Preserving URL citation annotations as sources in Agent API streams across completed and incomplete terminal responses. - Emitting each Agent API source URL once while maintaining search result IDs for citation correlation when a URL is fetched or annotated before appearing in search results.
Actionable summary
Breaking update in @ai-sdk/perplexity@5.0.0 migrates to Perplexity Agent API. Replaces Sonar model IDs/options with Agent API presets/models/tools, alters metadata/streaming events, and drops Sonar PDF input plus image/video results.
- Agent usefulness
- 94/100
- Confidence
- 96%
- Canonical data
- JSON + Markdown
What builders should check
- Update model configurations to replace deprecated Sonar model IDs and provider options with Agent API presets, models, and tools.
- Remove dependencies on Sonar PDF inputs as well as image and video results.
- Update downstream consumers handling raw stream events, request/response metadata, and usage/cost data to match the new Agent API formats.