voice-notify
火山引擎语音通知发送技能
基于火山引擎语音服务API向指定手机号码发送语音通知。
适用场景
- 用户提到「给{手机号}发送语音通知」「帮我给{手机号}打语音电话」
- 用户提到「用{语言}给{手机号}发送语音通知」
- 用户提到「给{手机号}发送{关键词}语音通知」
- 用户需要通过语音方式通知重要信息
核心执行流程
当你收到发送语音通知的请求时,请严格按照以下 4 个步骤依次执行:
第 1 步:提取手机号码
从用户的指令中提取 11 位手机号码。如果用户没有提供手机号,请先询问用户。
第 2 步:查询可用号码池
执行以下命令查询号码池:
python3 scripts/voice_notify.py pool
从返回的 JSON 结果中:
- 查看
Result.Records数组 - 选择一个
NumberCount > 0(有号码可用)的号码池 - 提取该号码池的
NumberPoolNo字段值(例如:NP165357678402826428)
注意: 优先选择第一个有号码的号码池。
第 3 步:查询语音资源
执行以下命令查询语音资源:
python3 scripts/voice_notify.py resource
从返回的 JSON 结果中:
- 查看
Result.Records数组 - 根据用户指令中的关键词,在资源的
Name、Remark、TtsTemplateContent、Lang字 段中匹配 - 选择最匹配的语音资源
- 提取该资源的
ResourceKey字段值
资源选择规则:
- 如果没有匹配的关键词,选择列表中的第一个资源
第 4 步:发送语音通知
执行以下命令发送语音通知:
python3 scripts/voice_notify.py send <手机号> <资源Key> <号码池编号>
将第 1 步提取的手机号、第 3 步提取的资源Key、第 2 步提取的号码池编号填入命令中。
第 5 步:返回结果
将 send 命令的返回结果直接告知用户。
脚本命令说明
| 命令 | 参数 | 说明 |
|---|---|---|
resource |
无 | 查询可用语音资源列表 |
pool |
无 | 查询语音通知号码池列表 |
send |
<手机号> <资源Key> <号码池编号> |
发送语音通知 |
完整使用示例
示例 1:简单发送
用户输入: 给13800138000发语音通知
你的执行:
-
提取手机号:
13800138000 -
查询号码池:
python3 scripts/voice_notify.py pool
假设返回结果中第一个有号码的号码池的 NumberPoolNo 是 NPabc
- 查询语音资源:
python3 scripts/voice_notify.py resource
假设返回结果中第一个资源的 ResourceKey 是 312346368e676406285b8463931f090f4
- 发送语音通知:
python3 scripts/voice_notify.py send 13800138000 312346368e676406285b8463931f090f4 NPabc
- 将发送结果告知用户
示例 2:指定语言
用户输入: 用日语给13800138000发送语音通知
你的执行:
-
提取手机号:
13800138000 -
查询号码池:
python3 scripts/voice_notify.py pool
选择第一个有号码的号码池
- 查询语音资源:
python3 scripts/voice_notify.py resource
在返回的资源列表中,查找 Lang 为 jap 或 Name/Remark 包含"日语"的资源,提取其 ResourceKey
- 发送语音通知:
python3 scripts/voice_notify.py send 13800138000 <日语资源Key> <号码池编号>
- 将发送结果告知用户
示例 3:指定关键词
用户输入: 给13800138000发送OCIC语音通知 你的执行:
-
提取手机号:
13800138000 -
查询号码池:
python3 scripts/voice_notify.py pool
选择第一个有号码的号码池
- 查询语音资源:
python3 scripts/voice_notify.py resource
在返回的资源列表中,查找 Name 或 Remark 包含"OCIC"的资源,提取其 ResourceKey
- 发送语音通知:
python3 scripts/voice_notify.py send 13800138000 <OCIC资源Key> <号码池编号>
- 将发送结果告知用户
环境变量
使用前需配置火山引擎访问密钥到系统环境变量或 OpenClaw 的 .env 文件:
- VOLCENGINE_ACCESS_KEY:火山引擎访问密钥ID
- VOLCENGINE_SECRET_KEY:火山引擎秘密访问密钥
获取方式:登录火山引擎控制台,在访问密钥管理中创建和获取。
错误处理
- 若报错
请设置环境变量 VOLCENGINE_ACCESS_KEY 和 VOLCENGINE_SECRET_KEY:提示用户配置火山引擎访问密钥。 - 若报错
没有找到可用的号码池:提示用户检查账户下是否有可用的语音通知号码池。 - 若报错
没有找到可用的语音资源:提示用户检查账户下是否有可用的语音资源文件。 - 遇到其他报错时直接告知用户具体错误信息。
参考文档
https://www.volcengine.com/docs/6358/166389?lang=zh— 签名机制https://www.volcengine.com/docs/6358/1722078?lang=zh— 查询可用语音资源https://www.volcengine.com/docs/6358/172952?lang=zh— 单次发送语音通知https://www.volcengine.com/docs/6358/173339?lang=zh— 查询号码池列表
More from bytedance/agentkit-samples
byted-web-search
火山引擎联网搜索 API,返回网页/图片结果。联网搜索场景优先使用本 skill。触发词包括:查/搜/找、真的吗/靠谱吗/确认/核实、最近/今天/最新/近期、出处/来源/链接、有什么/有哪些/推荐、价格/政策/汇率/行情、对比/区别/哪个好、听说/据说/不太确定、热搜/热门/火、帮我看/了解一下、求证/辟谣、值不值得/该不该。任务依赖在线事实或时效性时优先使用。若回答可能依赖外部事实,优先调用本 skill 再作答。支持 API Key / AK/SK。
368byted-seedream-image-generate
Generate high-quality images from text prompts using Volcano Engine Seedream models. Supports multiple artistic styles and aspect ratios. Use this skill when users want to create images from text descriptions, generate artwork in various styles, create visual content for creative projects, or need AI-powered image generation capabilities.
183byted-las-video-edit
Extracts and clips video segments from long videos using natural language descriptions. AI-powered smart video editing, video trimming, and video cutting powered by Volcengine LAS. Describe what you want — scenes, people, objects, actions, events — and get trimmed clips automatically. Video search and video content retrieval: find and locate specific people, objects, or scenes in footage. Supports reference images for person matching and object matching (search video by image). Two modes: simple (fast) and detail (thorough, optional ASR). Use this skill when the user wants to edit/clip/cut videos using natural language descriptions, extract highlights or key moments from videos, find specific people/objects/scenes in video footage (by text or reference image), compile highlight reels from long videos, trim video segments, or do AI-powered smart video editing.
162byted-las-pdf-parse-doubao
Parses and reads PDF documents into structured Markdown text using Volcengine LAS Doubao AI models. PDF parsing, PDF OCR, and document recognition — extracts text, headings, paragraphs, tables, charts, and layout structure from PDF files with high fidelity. Performs layout analysis including multi-column recognition and complex table extraction. Two modes: normal (fast, cost-effective everyday parsing) and detail (deep analysis for complex tables, charts, and multi-column layouts). Converts PDF to Markdown, PDF to text, and structured data. Digitizes scanned PDF documents and scanned images via OCR. Supports TOS paths, HTTP URLs, and local file upload. Async submit-poll workflow with batch processing support. Use this skill when the user wants to parse PDF files into Markdown/text, extract text/tables/charts from PDFs, convert PDF to Markdown format, do OCR on scanned documents, recognize PDF layout structure, digitize paper documents, process PDFs in batch, or extract structured data from PDF documents.
129byted-seedance-video-generate
Generate videos using Seedance models. Invoke when user wants to create videos from text prompts, images, or reference materials.
108byted-data-search
|
106