Voice Agent
This skill allows you to speak and listen to the user using a local Voice Agent API.
It is client-only and does not start containers or services.
It uses local Whisper for Speech-to-Text transcription and AWS Polly for Text-to-Speech generation.
Prerequisite
Requires a running backend API at
http://localhost:8000.
Backend setup instructions are in this repository:
- - INLINECODE1
- INLINECODE2
- INLINECODE3
Behavior Guidelines
- - Audio First: When the user communicates via audio (files), your PRIMARY mode of response is Audio File.
- Silent Delivery: When sending an audio response, DO NOT send a text explanation like "I sent an audio". Just send the audio file.
- Workflow:
1. User sends audio.
2. Use
transcribe to read it.
3. You think of a response.
4. Use
synthesize to generate the audio file.
5. You send the file.
6.
STOP. Do not add text commentary.
- - Failure Handling: If
health fails or connection errors occur, do not attempt service management from this skill. Ask the user to start or fix the backend using the repository docs.
Tools
Transcribe File
To transcribe an audio file with
local Whisper STT, run the client script with the
transcribe command.
CODEBLOCK0
Synthesize to File
To generate audio from text with
AWS Polly TTS and save it to a file, run the client script with the
synthesize command.
CODEBLOCK1
Health Check
To check if the voice agent API is running and healthy:
CODEBLOCK2
语音助手
此技能允许您通过本地语音助手API与用户进行语音对话。
它仅作为客户端运行,不会启动容器或服务。
它使用本地Whisper进行语音转文字转录,并使用AWS Polly进行文字转语音生成。
前置条件
需要在 http://localhost:8000 运行一个后端API。
后端设置说明位于此仓库中:
- - README.md
- walkthrough.md
- DOCKER_README.md
行为准则
- - 音频优先:当用户通过音频(文件)进行交流时,您的首要回复模式是音频文件。
- 静默交付:在发送音频回复时,不要发送类似我发送了一段音频的文字说明。只需发送音频文件。
- 工作流程:
1. 用户发送音频。
2. 使用 transcribe 读取音频。
3. 您思考回复内容。
4. 使用 synthesize 生成音频文件。
5. 您发送该文件。
6.
停止。不要添加文字评论。
- - 故障处理:如果 health 检查失败或出现连接错误,请勿通过此技能尝试服务管理。请用户使用仓库文档启动或修复后端。
工具
转录文件
要使用
本地Whisper STT转录音频文件,请使用 transcribe 命令运行客户端脚本。
bash
python3 {baseDir}/scripts/client.py transcribe /path/to/audio/file.ogg
合成文件
要使用
AWS Polly TTS从文本生成音频并保存到文件,请使用 synthesize 命令运行客户端脚本。
bash
python3 {baseDir}/scripts/client.py synthesize 要朗读的文本 --output /path/to/output.mp3
健康检查
检查语音助手API是否正在运行且健康:
bash
python3 {baseDir}/scripts/client.py health