返回全部动态
Vercel AI SDK 更新:xAI 集成新增语音时间戳与错误解析
原标题:@ai-sdk/xai@4.0.40
AI 摘要
Vercel AI SDK 发布了 @ai-sdk/xai 4.0.40 版本,新增了文本转语音的语音时间戳、发音替换、提供商元数据和错误解析功能。该版本支持通过 withTimestamps 和 replace 选项,在 providerMetadata.xai 中暴露音频时长、内容类型和字符级对齐信息,并返回 traceId。同时改进了错误解析,使 APICallError 消息携带 xAI 的真实错误详情。
以上摘要由 AI 生成,可能存在误差。事实请以原文为准。
正文节选
### Patch Changes - 1ffa1d2: feat(xai): speech timestamps, pronunciation replacements, provider metadata, and error parsing - Add `withTimestamps` and `replace` provider options for text to speech. With `withTimestamps`, the JSON envelope is decoded and the audio returned as usual, while duration, content type, and character-level alignment are exposed via `providerMetadata.xai`. - Return `providerMetadata.xai.traceId` (from the `x-trace-id` response
发布时间:2026-08-16 02:54
抓取时间:2026-08-16 03:53
来源机构:Vercel