Loading...
Loading...
Compare original and translation side by side
GIGGLE_API_KEYImportant: Never passin exec'sGIGGLE_API_KEYparameter. API Key is read from system environment variable.env
No Retry on Error: If script execution encounters an error, do not retry. Report the error to the user directly and stop.
GIGGLE_API_KEY重要提示:绝对不要在exec的参数中传递env。API密钥从系统环境变量中读取。GIGGLE_API_KEY
错误时不重试:如果脚本执行遇到错误,请勿重试。直接向用户报告错误并停止操作。
| 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; do not add or rewrite. E.g. user says "female voice, 1 min, ancient romance", use--promptdirectly.--prompt "female voice, 1 min, ancient romance"
| 用户输入 | 模式 | 说明 |
|---|---|---|
| 用户提供完整歌词 | 自定义模式(B) | 必须是歌词,而非描述 |
| 用户请求器乐/背景音乐 | 器乐模式(C) | 无 vocals |
| 其他情况(描述、风格、人声等) | 简化模式(A) | 使用用户描述作为提示词;由AI完成编曲 |
核心规则:如果用户未提供歌词,始终使用简化模式A。直接将用户的描述作为参数;请勿添加或改写。例如:用户说“女声,1分钟,古风言情”,则直接使用--prompt。--prompt "女声,1分钟,古风言情"
Question: "What type of music would you like to generate?"
Options: AI compose (describe style) / Use my lyrics / Instrumental问题:“你想要生成什么类型的音乐?”
选项:AI创作(描述风格)/ 使用我的歌词 / 器乐task_idtask_idpython3 scripts/giggle_music_api.py --prompt "user description"python3 scripts/giggle_music_api.py --prompt "用户描述"python3 scripts/giggle_music_api.py --custom \
--prompt "lyrics content" \
--style "pop, ballad" \
--title "Song Title" \
--vocal-gender femalepython3 scripts/giggle_music_api.py --custom \
--prompt "歌词内容" \
--style "pop, ballad" \
--title "歌曲标题" \
--vocal-gender femalepython3 scripts/giggle_music_api.py --prompt "user description" --instrumental{"status": "started", "task_id": "xxx"}addMemorygiggle-generation-music task_id: xxx (submitted: YYYY-MM-DD HH:mm)python3 scripts/giggle_music_api.py --prompt "用户描述" --instrumental{"status": "started", "task_id": "xxx"}addMemorygiggle-generation-music task_id: xxx (submitted: YYYY-MM-DD HH:mm)python3 scripts/giggle_music_api.py --query --task-id <task_id>| stdout pattern | Action |
|---|---|
| Plain text with music links (🎶 音乐已就绪) | Forward to user as-is |
| Plain text with error | Forward to user as-is |
JSON | Tell user "Still in progress, please ask again in a moment" |
https://assets.giggle.pro/...?Policy=...&Key-Pair-Id=...&Signature=...python3 scripts/giggle_music_api.py --query --task-id <task_id>| 标准输出格式 | 操作 |
|---|---|
| 包含音乐链接的纯文本(🎶 音乐已就绪) | 直接转发给用户 |
| 包含错误信息的纯文本 | 直接转发给用户 |
JSON格式 | 告知用户“仍在处理中,请稍后再问” |
https://assets.giggle.pro/...?Policy=...&Key-Pair-Id=...&Signature=...--query --task-id xxx--query --task-id xxx| Parameter | Description |
|---|---|
| Music description or lyrics (required in simplified mode) |
| Enable custom mode |
| Music style (required in custom mode) |
| Song title (required in custom mode) |
| Generate instrumental |
| Vocal gender: male / female (custom mode only) |
| Query task status |
| Task ID (use with --query) |
| 参数 | 说明 |
|---|---|
| 音乐描述或歌词(简化模式下为必填项) |
| 启用自定义模式 |
| 音乐风格(自定义模式下为必填项) |
| 歌曲标题(自定义模式下为必填项) |
| 生成器乐 |
| 人声性别:male / female(仅适用于自定义模式) |
| 查询任务状态 |
| 任务ID(与--query配合使用) |