@ai-sdk/perplexity@5.0.0
Vercel AI SDK's @ai-sdk/perplexity package released version 5.0.0, introducing a breaking migration from the Sonar Chat Completions API to the Perplexity Agent API, altering models, options, streaming behavior, and citations.
原始内容为英文;当前页面提供中文导航与来源说明,具体事实请以原文为准。
为什么值得关注
The @ai-sdk/perplexity package has released v5.0.0 with major breaking changes. Language generation is migrated from the Sonar Chat Completions API to the Agent API. This introduces replacements for Sonar model IDs and provider options with Agent API equivalents (presets, models, and tools). Key functional differences include altered request/response metadata, raw stream events, and usage/cost structures, as well as the loss of support for Sonar PDF inputs and image/video results. Patch changes alongside the release include text recovery from Agent API terminal events/output items to prevent delta duplication, distinct tracking for each message content part, support for native Agent API tool traces (e.g., finance) without web search validation, preservation of URL citations across streams, and deduplication of source URLs while maintaining search result IDs for correlation.
可执行摘要
BREAKING: @ai-sdk/perplexity@5.0.0 switches language generation from Sonar Chat Completions API to the Agent API. Sonar model IDs and options are replaced by Agent API presets, models, and tools. PDF input and image/video results are no longer supported, while metadata, stream events, usage, and tool traces have changed.
- Agent 实用度
- 94/100
- 可信度
- 96%
- 机器格式
- JSON + Markdown
开发者应核对什么
- Upgrade @ai-sdk/perplexity to version 5.0.0 if moving to the Agent API.
- Update Perplexity model IDs and provider options to Agent API presets, models, and tools.
- Remove dependencies on Sonar PDF inputs and image/video outputs, as they are unsupported in the Agent API.
- Adjust code handling raw stream events, request/response metadata, usage/cost metrics, and tool traces for compatibility with Agent API formats.