Vercel AI SDK 为多提供商流式响应新增 interrupted 状态
原标题:@ai-sdk/xai@5.0.28
AI 摘要
Vercel AI SDK 发布 @ai-sdk/xai@5.0.28 补丁版本,当流在没有收到提供商完成信号就干净结束时,现在会报告 `interrupted` 状态,保留部分输出而不因中断单独报错。该变更覆盖 OpenAI、Anthropic、Google、Alibaba、Amazon Bedrock、Cohere、DeepSeek、Groq、Mistral、Moonshot AI、Perplexity、xAI 等多家提供商的流式接口。这是一项破坏性兼容变更,应用需在 finish-reason 分支中处理 `interrupted`;同时更新了 @ai-sdk/provider 与 provider-utils 依赖。
正文节选
### Patch Changes - 43ad966: Report `interrupted` when a stream ends cleanly without its provider completion signal, preserving partial output without emitting an error solely for the interruption. This applies to OpenAI (Chat, Responses, and Completions), Anthropic, Google (Generate Content and Interactions), Alibaba, Amazon Bedrock Converse, Cohere, DeepSeek, Groq, Hugging Face Responses, Mistral Chat, Moonshot AI, Open Responses, Perplexity, and xAI Responses. It also covers cutoffs in la