Skip to main content

语音包

🌐 Voice Packages

语音包已从“speech”重命名为“voice”,并更新了类名和 API 方法。

🌐 Voice packages have been renamed from speech to voice with updated class names and API methods.

已更改
Direct link to 已更改

🌐 Changed

语音配置属性名称
Direct link to 语音配置属性名称

🌐 Voice configuration property names

语音配置属性已重命名以保持一致性。speakProvider 现在为 outputlistenProvider 现在为 inputrealtimeProvider 现在为 realtime。此更改提供了更直观的属性名称。

🌐 Voice configuration properties have been renamed for consistency. speakProvider is now output, listenProvider is now input, and realtimeProvider is now realtime. This change provides more intuitive property names.

在配置具有语音功能的代理时,要迁移,请更新配置属性名称。

🌐 To migrate, update configuration property names when configuring agents with voice capabilities.

  const agent = new Agent({
voice: {
- speakProvider: murfVoice,
- listenProvider: deepgramVoice,
- realtimeProvider: openaiRealtime,
+ output: murfVoice,
+ input: deepgramVoice,
+ realtime: openaiRealtime,
},
});
Codemod

你可以使用 Mastra 的 codemod CLI 来自动更新你的代码:

🌐 You can use Mastra's codemod CLI to update your code automatically:

npx @mastra/codemod@latest v1/voice-property-names .