Shengwang Integration
Workflow
Step 0: Ensure doc index exists (MANDATORY)
⚠️ Execute this BEFORE any routing or code generation.
Check if references/docs.txt already exists. If it does, skip this step entirely.
If it does not exist, download it:
bash skills/voice-ai-integration/scripts/fetch-docs.sh
This downloads a static doc index from
doc.shengwang.cn — no user data is sent.
If download fails, proceed with local reference docs and fallback URLs.
Step 1: Route to the correct product module
Match the user's request to a product module using the route table. If the match
is clear, route directly — do not ask extra questions.
Route Table
| User intent | Route to |
|---|
| Credentials, AppID, REST auth | general |
| Generate Token, token server, AccessToken2 |
token-server |
| ConvoAI voice agent work |
conversational-ai |
| RTC SDK integration |
rtc |
| RTM messaging / signaling |
rtm |
| Cloud Recording |
cloud-recording |
| Download SDK, sample project, GitHub repo | Route to the relevant product module above |
Product Recognition Aid
When the user describes a use case without naming a product, use this to infer the match:
| Product | What it does | Typical user says |
|---|
| ConvoAI | AI voice agent (ASR→LLM→TTS over RTC) | "AI语音", "voice bot", "对话式AI", "AI agent", "AI 客服" |
| RTC SDK |
Real-time audio/video between humans | "视频通话", "直播", "video call", "live streaming" |
| RTM | Real-time messaging / signaling | "聊天", "消息", "chat", "signaling" |
| Cloud Recording | Record RTC sessions server-side | "录制", "recording", "存档", "回看" |
| Token generation | Generate RTC / RTM tokens | "token", "鉴权", "token server" |
Common Combinations
| Use case | Products needed |
|---|
| AI voice assistant | ConvoAI (primary) + RTC SDK (client) |
| AI voice assistant + chat history |
ConvoAI + RTC SDK + RTM |
| 1v1 / group video call | RTC SDK |
| Video call + chat | RTC SDK + RTM |
| Live streaming with recording | RTC SDK + Cloud Recording |
| Record AI conversations | ConvoAI + RTC SDK + Cloud Recording |
| Chat / messaging only | RTM |
Routing Rules
- - Infer obvious context — do not ask if the answer is already clear
- Do not ask product-specific configuration questions (providers, SDK versions, project structure) at this level; let the product module handle those
- If the product is clear but the request mode is ambiguous (quickstart vs debugging vs feature), let the product module decide internally
- If multiple products are needed, route to the primary product first, then address supporting products in order
- ConvoAI has the most detailed internal routing (see its README.md); always delegate ConvoAI-specific decisions to its module
When the product is still unclear
If the route table and recognition aid above are not enough to determine the product:
- 1. Ask only for the missing detail that would change the routing decision
- Ask at most one question at a time
- Prefer natural wording over an interview script
- Once the product is clear, produce a short routing recap and continue:
ZH:
CODEBLOCK1
EN:
CODEBLOCK2
Do not stop for a separate confirmation step — continue to the product module automatically.
Step 2: Let the product module drive implementation
Each product module follows its own workflow. Do not duplicate implementation logic here.
Common pattern across modules:
- 1. Use local reference docs in
references/ first - Fetch remote docs via doc-fetching.md only when local references are insufficient
- Fallback to web search only after doc fetching has been attempted
Runtime Requirements
- -
bash and curl for local doc-fetch helper scripts - INLINECODE5 for sample-repo inspection when the sample-aligned path is chosen
- Network access to
doc.shengwang.cn, doc-mcp.shengwang.cn, and INLINECODE8
Network behavior:
- -
fetch-docs.sh downloads a static file from doc.shengwang.cn/llms.txt — no user data is sent - INLINECODE11 fetches a single doc page by URI from
doc-mcp.shengwang.cn — only the doc URI is sent, no user context - INLINECODE13 is used only for sample repo inspection from
gitee.com — only the repo URL is sent
Credential and service-activation requirements vary by product — see each product module and general/credentials-and-auth.md for details. Never hardcode credentials.
Safety & Consent Rules
- - Do not clone external repos into the user's main workspace by default — prefer a temporary path
- Do not modify an existing user project until the user explicitly asks for code generation
- Do not write secrets into project files — prefer env vars and example placeholders
- Before performing network fetches or repo clones, state what will be downloaded
- If a required dependency or credential is missing, stop and explain the blocker
Download Rules
- - Use
git clone --depth 1 <url> with HTTPS repo root URLs only - On any download failure: report the error, provide the URL for manual download, never silently skip
Links
- - Console: https://console.shengwang.cn/
- Docs (CN): https://doc.shengwang.cn/
- GitHub: https://github.com/Shengwang-Community
声网集成
工作流程
步骤 0:确保文档索引存在(必选)
⚠️ 在任何路由或代码生成之前执行此步骤。
检查 references/docs.txt 是否已存在。如果存在,则完全跳过此步骤。
如果不存在,请下载:
bash
bash skills/voice-ai-integration/scripts/fetch-docs.sh
这将从 doc.shengwang.cn 下载一个静态文档索引——不会发送任何用户数据。
如果下载失败,则使用本地参考文档和备用 URL 继续。
步骤 1:路由到正确的产品模块
使用路由表将用户的请求匹配到相应的产品模块。如果匹配明确,直接路由——不要提出额外问题。
路由表
| 用户意图 | 路由到 |
|---|
| 凭证、AppID、REST 认证 | 通用 |
| 生成 Token、Token 服务器、AccessToken2 |
token-server |
| ConvoAI 语音代理工作 |
conversational-ai |
| RTC SDK 集成 |
rtc |
| RTM 消息/信令 |
rtm |
| 云端录制 |
cloud-recording |
| 下载 SDK、示例项目、GitHub 仓库 | 路由到上述相关产品模块 |
产品识别辅助
当用户描述用例但未指定产品名称时,使用此表推断匹配:
| 产品 | 功能 | 用户典型表述 |
|---|
| ConvoAI | AI 语音代理(基于 RTC 的 ASR→LLM→TTS) | AI语音, voice bot, 对话式AI, AI agent, AI 客服 |
| RTC SDK |
人与人之间的实时音视频 | 视频通话, 直播, video call, live streaming |
| RTM | 实时消息/信令 | 聊天, 消息, chat, signaling |
| 云端录制 | 服务端录制 RTC 会话 | 录制, recording, 存档, 回看 |
| Token 生成 | 生成 RTC/RTM Token | token, 鉴权, token server |
常见组合
| 用例 | 所需产品 |
|---|
| AI 语音助手 | ConvoAI(主要)+ RTC SDK(客户端) |
| AI 语音助手 + 聊天记录 |
ConvoAI + RTC SDK + RTM |
| 一对一/群组视频通话 | RTC SDK |
| 视频通话 + 聊天 | RTC SDK + RTM |
| 带录制的直播 | RTC SDK + 云端录制 |
| 录制 AI 对话 | ConvoAI + RTC SDK + 云端录制 |
| 仅聊天/消息 | RTM |
路由规则
- - 推断明显的上下文——如果答案已经明确,不要提问
- 不要在此层级询问产品特定的配置问题(提供商、SDK 版本、项目结构);让产品模块自行处理
- 如果产品明确但请求模式不明确(快速入门 vs 调试 vs 功能),让产品模块内部决定
- 如果需要多个产品,先路由到主要产品,然后按顺序处理配套产品
- ConvoAI 拥有最详细的内部路由(参见其 README.md);始终将 ConvoAI 特定的决策委托给其模块
当产品仍不明确时
如果上述路由表和产品识别辅助不足以确定产品:
- 1. 仅询问会改变路由决策的缺失细节
- 一次最多问一个问题
- 优先使用自然措辞而非采访式脚本
- 一旦产品明确,生成简短的路由摘要并继续:
中文:
text
已了解的信息
─────────────────────────────
场景: [use case]
主要产品: [primary product]
配套产品: [supporting products / 无]
─────────────────────────────
英文:
text
What I have so far
─────────────────────────────
Use case: [use case]
Primary: [primary product]
Supporting: [supporting products / none]
─────────────────────────────
不要停下来进行单独的确认步骤——自动继续到产品模块。
步骤 2:让产品模块驱动实现
每个产品模块遵循自己的工作流程。不要在此处重复实现逻辑。
各模块的常见模式:
- 1. 首先使用 references/ 中的本地参考文档
- 仅当本地参考文档不足时,通过 doc-fetching.md 获取远程文档
- 仅在尝试获取文档后,才回退到网络搜索
运行时要求
- - 需要 bash 和 curl 用于本地文档获取辅助脚本
- 当选择示例对齐路径时,需要 git 用于示例仓库检查
- 需要网络访问 doc.shengwang.cn、doc-mcp.shengwang.cn 和 gitee.com
网络行为:
- - fetch-docs.sh 从 doc.shengwang.cn/llms.txt 下载静态文件——不会发送任何用户数据
- fetch-doc-content.sh 通过 URI 从 doc-mcp.shengwang.cn 获取单个文档页面——仅发送文档 URI,不发送用户上下文
- git clone 仅用于从 gitee.com 检查示例仓库——仅发送仓库 URL
凭证和服务激活要求因产品而异——详见各产品模块和 general/credentials-and-auth.md。切勿硬编码凭证。
安全与同意规则
- - 默认情况下,不要将外部仓库克隆到用户的主工作区——优先使用临时路径
- 在用户明确要求代码生成之前,不要修改现有的用户项目
- 不要将密钥写入项目文件——优先使用环境变量和示例占位符
- 在执行网络获取或仓库克隆之前,说明将要下载的内容
- 如果缺少必需的依赖项或凭证,停止并解释阻塞原因
下载规则
- - 仅使用 git clone --depth 1 和 HTTPS 仓库根 URL
- 任何下载失败时:报告错误,提供手动下载的 URL,切勿静默跳过
链接
- - 控制台:https://console.shengwang.cn/
- 文档(中文):https://doc.shengwang.cn/
- GitHub:https://github.com/Shengwang-Community