跳到主要内容
非官方简体中文翻译,内容版权归 Mastra 所有,遵循 Apache-2.0 许可。

Voice

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

Changed
Changed的直接链接

Voice configuration property names
Voice configuration property names的直接链接

Voice configuration properties have been renamed for consistency. speakProvider is now output, listenProvider is now input, and realtimeProvider is now realtime. The new names match each property's role in voice input and output.

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

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

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

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