← 返回 Skills 市场
delong-liu-bupt

Chinese Bedtime Story Generator

作者 Delong-liu-bupt · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
290
总下载
1
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install bedtime-story
功能描述
生成多角色中文睡前故事并合成语音。适用于用户想为孩子定制个性化睡前故事的场景:根据孩子姓名、年龄和兴趣,由 LLM 创建完整世界观和角色,生成分段故事文本(每段标注说话人),再由 TTS 以不同音色合成旁白、主角、小伙伴和长者的语音,最终拼接为完整 MP3 音频文件。支持连载模式(`--continue`)在多次...
使用说明 (SKILL.md)

中文睡前故事生成器

适用范围

此 Skill 用于生成可播放的多角色中文睡前故事音频。

能力边界:

  • 依赖 LLM 生成故事文本,TTS 合成多角色语音
  • 支持自定义孩子姓名、年龄、兴趣爱好
  • 支持连载模式,跨会话保持世界观和情节连贯
  • 输出完整 MP3 音频 + 故事文本 + 状态文件

不做:

  • 实时语音对话或 ASR 识别
  • 视频或动画生成
  • 英文故事

默认配置

  • child_name: 小朋友
  • age: 5
  • interests: 冒险,动物
  • episodes: 1(单集)

音色分配

角色 voice_id speed pitch
旁白 narrator male_0004_a 0.9 0
主角 protagonist child_0001_a 1.0 0
小伙伴 sidekick child_0001_b 1.0 0
长者 elder male_0018_a 0.85 -2

工作流

  1. 初始化

    • 读取 --child-name--age--interests 参数
    • --continue,从 story_state.json 加载已有世界观和角色
  2. 世界观与角色创建(首次运行)

    • LLM 生成世界名称、背景设定、4个角色(旁白/主角/小伙伴/长者)
    • 主角名称默认使用孩子姓名
  3. 故事生成

    • LLM 生成 12-20 段 segments,每段标注 speaker 和 text
    • 连载模式下传入上集摘要,保持情节连贯
  4. TTS 多角色合成

    • 逐段根据 speaker 选择对应音色参数
    • 合成每段音频
  5. 音频拼接

    • MP3 帧独立可解码,直接二进制追加拼接
    • 无需 ffmpeg
  6. 保存输出

    • story_state.json:世界观+角色+情节摘要
    • story_ep{N}.txt:故事文本
    • story_ep{N}.mp3:完整音频

Prompt 模块

详见 references/prompts_cn.md

数据结构

详见 references/state_schema_cn.md

直接运行

pip install -r requirements.txt

# 首次生成
python scripts/run_story.py --child-name "小明" --age 5 --interests "恐龙,太空"

# 连载续写
python scripts/run_story.py --continue

# 不调用 TTS,仅输出文本
python scripts/run_story.py --child-name "小红" --age 7 --interests "魔法,精灵" --no-tts

# 生成多集
python scripts/run_story.py --child-name "小明" --age 5 --interests "恐龙,太空" --episodes 3

环境变量参考:.env.example

接口约定:

  • LLM 读取 STORY_LLM_API_KEY,回退到 IME_MODEL_API_KEY
  • TTS 读取 STORY_TTS_API_KEY,回退到 SENSEAUDIO_API_KEY
安全使用建议
Before installing or running this skill: (1) be aware it will send the child's name, age, interests and generated story text to external LLM and TTS services (defaults point to models.audiozen.cn and api.senseaudio.cn). Verify you trust those providers and their privacy policies. (2) The registry metadata did not declare the required API keys; you must set environment variables (STORY_LLM_API_KEY or IME_MODEL_API_KEY for the LLM; SENSEAUDIO_API_KEY for TTS) or the script will exit. (3) There is a small mismatch between SKILL.md and the code regarding the TTS key name — inspect or test the script in a sandbox first. (4) If you care about privacy, either use non-identifying test data or host your own LLM/TTS endpoints and set STORY_LLM_BASE_URL / STORY_TTS_URL accordingly. (5) If you need greater assurance, review the full scripts/run_story.py content and the remote endpoints the code calls, or ask the publisher for explicit documentation of required env vars and endpoints.
功能分析
Type: OpenClaw Skill Name: bedtime-story Version: 1.0.1 The skill bundle is a legitimate tool designed to generate multi-character Chinese bedtime stories using LLM and TTS services. The core logic in `scripts/run_story.py` uses the OpenAI API for story generation and a specific TTS API (SenseAudio) for voice synthesis, with all network activity directed to relevant service endpoints (audiozen.cn and senseaudio.cn). The script handles data safely using standard libraries, manages state via local JSON files, and lacks any indicators of malicious intent, data exfiltration, or prompt injection.
能力评估
Purpose & Capability
The skill's stated purpose is generating multi-role Chinese bedtime stories and synthesizing them to MP3 — the code implements exactly that (LLM calls to generate JSON story text, per-segment TTS calls, saving outputs). However, the registry metadata declares no required environment variables or primary credential even though the code requires API keys for the LLM and TTS providers. That mismatch (declared none vs. actual required credentials) is a substantive inconsistency that reduces transparency.
Instruction Scope
SKILL.md instructions and the code are largely aligned: they read CLI args, optionally load story_state.json for continuation, call an LLM to create world/segments, call a TTS API per segment, and write files under an outputs/ directory. A small mismatch: SKILL.md says TTS reads STORY_TTS_API_KEY fallback to SENSEAUDIO_API_KEY whereas the code only uses SENSEAUDIO_API_KEY; the SKILL.md also claims LLM key fallback to IME_MODEL_API_KEY which the code implements. The code does not attempt to read unrelated system files beyond optional .env files and the outputs/story_state.json it manages itself.
Install Mechanism
There is no installer/spec; the skill is instruction+script based and provides requirements.txt (openai, requests, python-dotenv). No arbitrary remote downloads or extract operations are specified. This is low-risk from an installation footprint perspective, but it does require installing Python packages.
Credentials
The skill actually requires API keys at runtime (LLM: STORY_LLM_API_KEY or IME_MODEL_API_KEY; TTS: SENSEAUDIO_API_KEY as coded). The registry metadata lists no required env vars or primary credential, which is misleading. The skill will transmit the child's name, age, interests and story text to external LLM/TTS services (defaults: https://models.audiozen.cn and https://api.senseaudio.cn). Requesting those keys is proportionate to the function, but the omission from metadata and the presence of third-party endpoints handling child-identifying data are privacy-relevant and should be made explicit to users.
Persistence & Privilege
always is false and disable-model-invocation is false (normal). The skill writes its own outputs/story_state.json and episode files under an outputs/ directory; it does not request system-wide configuration or modify other skills. No elevated or permanent platform privileges are requested.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install bedtime-story
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /bedtime-story 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- No code changes detected in this version. - Documentation and skill metadata remain unchanged.
v1.0.0
Initial release. Generates multi-character Chinese bedtime stories with TTS audio output. Supports custom child name, age, and interests. Features multi-voice synthesis (narrator, protagonist, sidekick, elder) and serial mode to maintain continuity across sessions.
元数据
Slug bedtime-story
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Chinese Bedtime Story Generator 是什么?

生成多角色中文睡前故事并合成语音。适用于用户想为孩子定制个性化睡前故事的场景:根据孩子姓名、年龄和兴趣,由 LLM 创建完整世界观和角色,生成分段故事文本(每段标注说话人),再由 TTS 以不同音色合成旁白、主角、小伙伴和长者的语音,最终拼接为完整 MP3 音频文件。支持连载模式(`--continue`)在多次... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 290 次。

如何安装 Chinese Bedtime Story Generator?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install bedtime-story」即可一键安装,无需额外配置。

Chinese Bedtime Story Generator 是免费的吗?

是的,Chinese Bedtime Story Generator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Chinese Bedtime Story Generator 支持哪些平台?

Chinese Bedtime Story Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Chinese Bedtime Story Generator?

由 Delong-liu-bupt(@delong-liu-bupt)开发并维护,当前版本 v1.0.1。

💬 留言讨论