voice-ai-development
构建实时语音AI应用
语音AI应用需要精心协调语音转文本、语言模型和文本转语音。本技能提供专家指导,帮助您使用OpenAI Realtime API、Vapi、Deepgram和ElevenLabs构建响应灵敏的语音代理。
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“voice-ai-development”。 How do I set up a voice agent with Vapi?
预期结果:
Here's how to create a basic voice agent with Vapi:
1. Install the Vapi SDK: `pip install vapi`
2. Create a Vapi client with your API key
3. Define your assistant with model, voice, and transcriber settings
4. Set up a webhook to handle conversation events
The assistant configuration includes provider selection (OpenAI, Anthropic), voice choice (ElevenLabs voices), and transcription settings (Deepgram models).
正在使用“voice-ai-development”。 What is the best approach for low-latency voice AI?
预期结果:
For optimal latency:
1. Stream everything - use interim STT results, stream LLM tokens, chunk TTS output
2. Start TTS before LLM completes - begin speaking while generating
3. Use proximity - deploy services in regions near your users
4. Choose fast models - eleven_turbo_v2_5 for TTS, nova-2 for STT
5. Implement proper audio chunking - send small buffers frequently
The goal is keeping perceived latency under 700ms for natural conversation.
安全审计
安全Security analysis confirms this is a legitimate voice AI development skill. Static findings for external_commands, env_access, and weak_crypto are all false positives - the scanner misidentified markdown code fences as shell commands and placeholder API key patterns as actual secrets. No malicious code detected.
高风险问题 (2)
质量评分
你能构建什么
客户支持语音代理
构建一个交互式语音代理,用于处理客户咨询、路由通话,并使用Vapi和Deepgram提供全天候支持。
实时语音助手
使用OpenAI Realtime API创建低延迟语音助手,在Web或移动应用中提供自然的对话体验。
无障碍语音界面
为现有应用添加语音输入和输出,以改善偏好语音交互的用户的使用体验。
试试这些提示
帮助我使用Vapi设置一个基础的语音AI代理。我想创建一个简单的代理,可以使用OpenAI模型和ElevenLabs语音回答关于我产品的问题。
展示如何为语音应用实现OpenAI Realtime API。我需要处理来自麦克风的音频输入,将其发送到GPT-4o,并将音频响应流式传输回来。
我的语音代理感觉很慢。用户说话后,需要等待很长时间才会收到回复。我如何优化管道以减少感知延迟?我使用Deepgram进行STT,使用ElevenLabs进行TTS。
如何实现打断检测,让用户可以在语音代理说话时进行中断?当用户开始说话时,我希望代理立即停止。
最佳实践
- 始终在管道的每个阶段流式传输音频 - STT临时结果、LLM令牌流式传输和TTS分块输出
- 在LLM完成响应之前就开始TTS生成,以最大程度减少感知延迟
- 使用VAD实现适当的中断处理,以检测用户何时想说话
避免
- 等待完整的STT转录后再发送到LLM - 这会增加数秒延迟
- 忽略用户中断 - 用户开始说话时未停止TTS会产生令人沮丧的对话
- 为所有功能使用单一提供商 - 组合使用专业提供商(Deepgram用于STT,ElevenLabs用于TTS)效果更好