SuperAPI AI 工具集

voice-agents

智能体与模型

查看项目

更新于 10-14 22:02

技能介绍

Voice Agents 是 sickn33/agentic-awesome-skills 下的一个技能,主题是语音智能体(Voice Agents)。资料将其描述为 AI 交互的前沿——人类与 AI 系统进行自然对话。

用途与定位 该技能面向构建语音智能体的任务。资料指出,其挑战不只是语音识别与合成,而是要在处理打断、背景噪声和情感细微差别的同时,实现低于 800 毫秒延迟的自然对话流。核心洞察是:延迟是约束条件,人类期望在 500 毫秒内得到响应,每一毫秒都重要。资料还提到,2025 年 84% 的组织正在增加语音 AI 预算,并称这是语音智能体走向主流的一年。

主要能力与架构 该技能覆盖两种架构:

  1. 语音到语音(speech-to-speech):资料以 OpenAI Realtime API 为例,称其延迟最低、最自然。
  2. 流水线式(pipeline):即 STT→LLM→TTS,资料称其控制力更强、更易调试。

使用方式 资料要求在执行该技能前先阅读详细指南(Detailed Guide),该指南保留完整流程与参考资料,其安全、前置条件和验证要求被视为强制性的。对于聚焦型工作,可加载相关章节;对于端到端工作,需完整阅读指南。

资料给出了一个生产流水线示例(代码原样保留):

""" import { Deepgram } from '@deepgram/sdk'; import { ElevenLabsClient } from 'elevenlabs'; import OpenAI from 'openai';

// Initialize clients const deepgram = new Deepgram(process.env.DEEPGRAM_API_KEY); const elevenlabs = new ElevenLabsClient(); const openai = new OpenAI();

async function processVoiceInput(audioStream) { // 1. Speech-to-Text (Deepgram Nova-3) const transcription = await deepgram.transcription.live({ model: 'nova-3', punctuate: true, endpointing: 300, // ms of silence before end });

transcription.on('transcript', async (data) => { if (data.is_final && data.speech_final) { const userText = data.channel.alternatives[0].transcript; console.log('User:', userText);

// 2. LLM Processing const completion = await openai.chat.completions.create({ model: 'gpt-4o-mini', messages: [ { role: 'system', content: 'You are a concise voice assistant.' }, { role: 'user', content: userText } ], max_tokens: 150, // Keep responses short for voice });

const agentText = completion.choices[0].message.content; console.log('Agent:', agentText);

// 3. Text-to-Speech (ElevenLabs) const audioStream = await elevenlabs.textToSpeech.stream({ voice_id: 'voice_id_here', text: agentText, model_id: 'eleven_flash_v2_5', // Lowest latency });

// Stream to user playAudioStream(audioStream); }

});

// Pipe audio to transcription audioStream.pipe(transcription); } """

优化建议(Optimization Tips):

  • 在 LLM 仍在生成时就开始 TTS(流式)。
  • 在用户说话期间预先计算首个响应片段。
  • 使用 Flash/turbo 模型以降低延迟。

语音活动检测(VAD)模式 资料说明 VAD 用于检测用户何时开始/停止说话,适用场景为:所有语音智能体都需要 VAD 来进行轮次切换(turn-taking)。

VAD 类型:

  • 基于能量(Energy-based):简单、快速、对噪声敏感。
  • 基于模型(Model-based):如 Silero VAD,更准确。
  • 语义 VAD(Semantic VAD):理解含义,最适合对话。

适用场景(触发条件) 当用户提及或暗示以下内容时使用:voice agent、speech to text、text to speech、whisper、elevenlabs、deepgram、realtime api、voice assistant、voice ai、conversational ai、tts、stt、asr。

限制

  • 仅当任务明确匹配上述范围时使用该技能。
  • 不得将输出视为环境特定验证、测试或专家评审的替代品。
  • 如果缺少必需的输入、权限、安全边界或成功标准,应停止并请求澄清。

其他事实(如收费、价格、平台支持范围等)暂未提供。