简体中文 | English
Giggle Music
Source: giggle-official/skills · API: giggle.pro
Generates AI music via giggle.pro. Supports simplified and custom modes. Submit task → query when ready. No polling or Cron.
API Key: Set system environment variable GIGGLE_API_KEY. Log in to Giggle.pro and obtain the API Key from account settings.
Important: Never pass GIGGLE_API_KEY in exec's env parameter. API Key is read from system environment variable.
No Retry on Error: If script execution encounters an error, do not retry. Report the error to the user directly and stop.
Interaction Guide
Mode Selection (priority: high to low)
| User input | Mode | Description |
|---|
| User provides full lyrics | Custom mode (B) | Must be lyrics, not description |
| User requests instrumental/background music |
Instrumental mode (C) | No vocals |
| Other cases (description, style, vocals, etc.) |
Simplified mode (A) | Use user description as prompt; AI composes |
Key rule: If the user does not provide lyrics, always use simplified mode A. Use the user's description exactly as --prompt; do not add or rewrite. E.g. user says "female voice, 1 min, ancient romance", use --prompt "female voice, 1 min, ancient romance" directly.
Guidance when info is lacking
Only when the user input is very vague (e.g. "generate music" with no description), ask:
CODEBLOCK0
Execution Flow: Submit and Query
Music generation is asynchronous (typically 1–3 minutes). Submit a task to get task_id, then query when the user wants to check status.
Step 1: Submit Task
First send a message to the user: "Music generation submitted. Usually takes 1–3 minutes. You can ask me about the progress anytime."
A: Simplified Mode
CODEBLOCK1
B: Custom Mode
CODEBLOCK2
C: Instrumental
CODEBLOCK3
Response example:
CODEBLOCK4
Store task_id in memory (addMemory):
giggle-generation-music task_id: xxx (submitted: YYYY-MM-DD HH:mm)
Step 2: Query When User Asks
When the user asks about music progress (e.g. "is my music ready?", "progress?"), run:
CODEBLOCK6
Output handling:
| stdout pattern | Action |
|---|
| Plain text with music links (🎶 音乐已就绪) | Forward to user as-is |
| Plain text with error |
Forward to user as-is |
| JSON
{"status": "processing", "task_id": "..."} | Tell user "Still in progress, please ask again in a moment" |
Link return rule: Audio links in stdout must be full signed URLs (with Policy, Key-Pair-Id, Signature query params). Correct: https://assets.giggle.pro/...?Policy=...&Key-Pair-Id=...&Signature=.... Keep as-is when forwarding.
Recovery
When the user asks about previous music progress:
- 1. taskid in memory → Run
--query --task-id xxx directly. Do not resubmit - No taskid in memory → Tell the user, ask if they want to regenerate
Parameter Reference
| Parameter | Description |
|---|
| INLINECODE10 | Music description or lyrics (required in simplified mode) |
| INLINECODE11 |
Enable custom mode |
|
--style | Music style (required in custom mode) |
|
--title | Song title (required in custom mode) |
|
--instrumental | Generate instrumental |
|
--vocal-gender | Vocal gender: male / female (custom mode only) |
|
--query | Query task status |
|
--task-id | Task ID (use with --query) |
技能名称: giggle-generation-music
详细描述:
简体中文 | English
Giggle Music
来源: giggle-official/skills · API: giggle.pro
通过 giggle.pro 生成 AI 音乐。支持简化模式和自定义模式。提交任务 → 就绪后查询。无需轮询或定时任务。
API 密钥: 设置系统环境变量 GIGGLEAPIKEY。登录 Giggle.pro,在账户设置中获取 API 密钥。
重要: 切勿在 exec 的 env 参数中传递 GIGGLEAPIKEY。API 密钥从系统环境变量读取。
出错不重试: 如果脚本执行出错,不要重试。直接向用户报告错误并停止。
交互指南
模式选择(优先级从高到低)
| 用户输入 | 模式 | 描述 |
|---|
| 用户提供完整歌词 | 自定义模式 (B) | 必须是歌词,而非描述 |
| 用户要求纯音乐/背景音乐 |
纯音乐模式 (C) | 无演唱 |
| 其他情况(描述、风格、演唱等) |
简化模式 (A) | 将用户描述作为提示词;AI 作曲 |
关键规则: 如果用户未提供歌词,始终使用简化模式 A。直接使用用户描述作为 --prompt;不要添加或改写。例如用户说“女声,1分钟,古风爱情”,直接使用 --prompt 女声,1分钟,古风爱情。
信息不足时的引导
仅当用户输入非常模糊时(例如只说“生成音乐”而无描述),询问:
问题:“您想生成什么类型的音乐?”
选项:AI 作曲(描述风格)/ 使用我的歌词 / 纯音乐
执行流程:提交与查询
音乐生成是异步的(通常 1–3 分钟)。提交任务获取 task_id,然后在用户想检查状态时查询。
步骤 1:提交任务
首先向用户发送消息:“音乐生成已提交,通常需要 1–3 分钟。您可以随时询问进度。”
A:简化模式
bash
python3 scripts/giggle
musicapi.py --prompt 用户描述
B:自定义模式
bash
python3 scripts/giggle
musicapi.py --custom \
--prompt 歌词内容 \
--style 流行,情歌 \
--title 歌曲标题 \
--vocal-gender female
C:纯音乐
bash
python3 scripts/giggle
musicapi.py --prompt 用户描述 --instrumental
响应示例:
json
{status: started, task_id: xxx}
将 task_id 存入内存(addMemory):
giggle-generation-music task_id: xxx (提交时间:YYYY-MM-DD HH:mm)
步骤 2:用户询问时查询
当用户询问音乐进度时(例如“我的音乐好了吗?”、“进度?”),运行:
bash
python3 scripts/gigglemusicapi.py --query --task-id
输出处理:
| stdout 模式 | 操作 |
|---|
| 包含音乐链接的纯文本(🎶 音乐已就绪) | 原样转发给用户 |
| 包含错误的纯文本 |
原样转发给用户 |
| JSON {status: processing, task_id: ...} | 告知用户“仍在处理中,请稍后再问” |
链接返回规则:stdout 中的音频链接必须是完整签名 URL(包含 Policy、Key-Pair-Id、Signature 查询参数)。正确示例:https://assets.giggle.pro/...?Policy=...&Key-Pair-Id=...&Signature=...。转发时保持原样。
恢复
当用户询问之前的音乐进度时:
- 1. 内存中有 taskid → 直接运行 --query --task-id xxx。不要重新提交
- 内存中无 taskid → 告知用户,询问是否需要重新生成
参数参考
| 参数 | 描述 |
|---|
| --prompt | 音乐描述或歌词(简化模式下必填) |
| --custom |
启用自定义模式 |
| --style | 音乐风格(自定义模式下必填) |
| --title | 歌曲标题(自定义模式下必填) |
| --instrumental | 生成纯音乐 |
| --vocal-gender | 演唱性别:male / female(仅自定义模式) |
| --query | 查询任务状态 |
| --task-id | 任务 ID(与 --query 配合使用) |