giggle-generation-drama
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese⚠️ Review Before Installing
⚠️ 安装前须知
Please review before installing. This skill will:
- Network – Calls Giggle.pro API for video generation
Requirements: , (system environment variable), pip packages:
python3GIGGLE_API_KEYrequestsNo Retry on Error: If script execution encounters an error, do not retry. Report the error to the user directly and stop.
请在安装前仔细阅读。 本Skill将:
- 网络 – 调用Giggle.pro API生成视频
要求:、(系统环境变量)、pip包:
python3GIGGLE_API_KEYrequests错误时不重试:如果脚本执行遇到错误,请勿重试。直接向用户报告错误并停止。
Required Setup Before First Use
首次使用前的必要设置
Before performing any operation, confirm the user has configured the API Key to avoid workflow failure due to auth errors.
- API Key: Log in to Giggle.pro and obtain the API Key from account settings.
- Configuration: Set system environment variable
GIGGLE_API_KEYexport GIGGLE_API_KEY=your_api_key
Verification steps:
- Confirm the user has configured in system environment.
GIGGLE_API_KEY - If not configured, guide the user:
Hello! Before using the video generation feature, you need to configure the API Key. Please go to Giggle.pro to get your API Key, then runin the terminal.
export GIGGLE_API_KEY=your_api_key - Wait for the user to configure before continuing the workflow.
在执行任何操作之前,请确认用户已配置API Key,避免因认证错误导致工作流失败。
- API Key:登录Giggle.pro,从账户设置中获取API Key。
- 配置:设置系统环境变量
GIGGLE_API_KEYexport GIGGLE_API_KEY=your_api_key
验证步骤:
- 确认用户已在系统环境中配置。
GIGGLE_API_KEY - 如果未配置,引导用户:
您好!在使用视频生成功能前,您需要配置API Key。请前往Giggle.pro获取您的API Key,然后在终端中运行。
export GIGGLE_API_KEY=your_api_key - 等待用户完成配置后再继续工作流。
Generation Modes
生成模式
Supports three modes. Ask the user to select a mode before starting the workflow. If not specified, default to Episodes mode ().
director| Mode | project_type | Description |
|---|---|---|
| Episodes | | AI-directed short drama with storyboards and shot language |
| Narration | | Narration-focused video |
| Short Film | | Story and visuals balanced; cinematic short film |
支持三种模式。在启动工作流前,请让用户选择一种模式。如果未指定,默认使用剧集模式()。
director| 模式 | project_type | 描述 |
|---|---|---|
| 剧集模式 | | AI执导的短剧,包含故事板和镜头语言 |
| 旁白模式 | | 以旁白为主的视频 |
| 短片模式 | | 故事与视觉效果平衡;电影质感短片 |
Main Workflow: execute_workflow
主要工作流:execute_workflow
Use to run the full workflow: submit + poll + auto-pay (if needed) + wait for completion. Call once and wait for return.
execute_workflow- Submit task
- Poll progress every 3 seconds
- Detect pending payment and auto-pay (if needed)
- Wait for completion (max 1 hour)
- Return video download link or error
使用运行完整工作流:提交 + 轮询 + 自动支付(如有需要) + 等待完成。调用一次并等待返回。
execute_workflow- 提交任务
- 每3秒轮询一次进度
- 检测待支付状态并自动支付(如有需要)
- 等待完成(最长1小时)
- 返回视频下载链接或错误信息
Function Signature
函数签名
python
execute_workflow(
diy_story: str, # Story/script content (required)
aspect: str, # Aspect ratio: 16:9 or 9:16 (required)
project_name: str, # Project name (required)
video_duration: str = "auto", # Duration, default "auto" (optional)
style_id: Optional[int] = None, # Style ID (optional)
project_type: str = "director", # Mode, default "director" (optional)
character_info: Optional[List[Dict]] = None # Character images (optional)
)python
execute_workflow(
diy_story: str, # 故事/脚本内容(必填)
aspect: str, # 宽高比:16:9 或 9:16(必填)
project_name: str, # 项目名称(必填)
video_duration: str = "auto", # 时长,默认值为"auto"(可选)
style_id: Optional[int] = None, # 风格ID(可选)
project_type: str = "director", # 模式,默认值为"director"(可选)
character_info: Optional[List[Dict]] = None # 角色图片(可选)
)Parameter Description
参数说明
| Parameter | Required | Description |
|---|---|---|
| diy_story | yes | Story or script content |
| aspect | yes | Aspect ratio: |
| project_name | yes | Project name |
| video_duration | no | |
| style_id | no | Style ID; omit if not specified |
| project_type | no | |
| character_info | no | Character image list: |
| 参数 | 是否必填 | 描述 |
|---|---|---|
| diy_story | 是 | 故事或脚本内容 |
| aspect | 是 | 宽高比: |
| project_name | 是 | 项目名称 |
| video_duration | 否 | |
| style_id | 否 | 风格ID;未指定则省略 |
| project_type | 否 | |
| character_info | 否 | 角色图片列表: |
Usage Flow
使用流程
-
Introduce and select generation mode (required): Before generating, must introduce the three modes and let the user choose. Display:We support three video generation modes. Please choose:Episodes (director): AI director handles storyboards and shot language. Good for short drama with dialogue and plot.Narration (narration): Narration-focused with visuals. Good for knowledge sharing, news commentary, product introductions.Short Film (short-film): Story and visuals balanced; cinematic shots and pacing. Good for emotional shorts, creative stories, artistic expression.Wait for explicit user choice before continuing. If not specified, default to Episodes.
-
If the user wants to pick a style: Callfor the style list; show ID, name, category, description; wait for choice before continuing.
get_styles() -
If the user provides character image URLs: Buildarray with
character_infoandnameper character.url -
Run workflow:
- Call with story, aspect ratio, project name.
execute_workflow() - Set per chosen mode; pass
project_typeif specified (elsevideo_duration); pass"auto"if chosen; passstyle_idif provided.character_info - Call once and wait — the function handles create, submit, poll, pay, and completion; returns download link or error.
- Call
-
介绍并选择生成模式(必填):在生成前,必须向用户介绍三种模式并让用户选择。显示内容:我们支持三种视频生成模式,请您选择:剧集模式(director):由AI导演负责故事板和镜头语言。适合带有对话和情节的短剧。旁白模式(narration):以旁白为主,搭配视觉内容。适合知识分享、新闻评论、产品介绍等场景。短片模式(short-film):故事与视觉效果平衡;采用电影质感的镜头和节奏。适合情感短片、创意故事、艺术表达等场景。等待用户明确选择后再继续。如果未指定,默认使用剧集模式。
-
如果用户想要选择风格:调用获取风格列表;展示ID、名称、分类、描述;等待用户选择后再继续。
get_styles() -
如果用户提供角色图片URL:为每个角色构建包含和
name的url数组。character_info -
运行工作流:
- 传入故事、宽高比、项目名称调用。
execute_workflow() - 根据用户选择的模式设置;如果指定了时长则传入
project_type(否则为video_duration);如果选择了风格则传入"auto";如果提供了角色信息则传入style_id。character_info - 调用一次并等待——该函数会处理创建、提交、轮询、支付和完成流程;返回下载链接或错误信息。
- 传入故事、宽高比、项目名称调用
Examples
示例
View style list:
python
api = TrusteeModeAPI()
styles_result = api.get_styles()查看风格列表:
python
api = TrusteeModeAPI()
styles_result = api.get_styles()Display style list to user
向用户展示风格列表
**Basic workflow (no duration, no style)**:
```python
api = TrusteeModeAPI()
result = api.execute_workflow(
diy_story="An adventure story...",
aspect="16:9",
project_name="My Video Project"
)
**基础工作流(无指定时长、无指定风格)**:
```python
api = TrusteeModeAPI()
result = api.execute_workflow(
diy_story="一个冒险故事...",
aspect="16:9",
project_name="我的视频项目"
)result contains download URL or error
result包含下载URL或错误信息
**Specify duration, no style**:
```python
result = api.execute_workflow(
diy_story="An adventure story...",
aspect="16:9",
project_name="My Video Project",
video_duration="60"
)Specify duration and style:
python
result = api.execute_workflow(
diy_story="An adventure story...",
aspect="16:9",
project_name="My Video Project",
video_duration="60",
style_id=142
)Narration mode:
python
result = api.execute_workflow(
diy_story="Today we'll talk about AI development...",
aspect="16:9",
project_name="Narration Video",
project_type="narration"
)Short film mode:
python
result = api.execute_workflow(
diy_story="Sunset. An old fisherman rows home alone. The sea glows red...",
aspect="16:9",
project_name="Short Film",
project_type="short-film"
)With character images (when user provides character image URLs):
python
result = api.execute_workflow(
diy_story="Xiao Ming and Xiao Hong meet in the park, they smile at each other...",
aspect="16:9",
project_name="Custom Character Video",
character_info=[
{"name": "Xiao Ming", "url": "https://xxx/xiaoming.jpg"},
{"name": "Xiao Hong", "url": "https://xxx/xiaohong.jpg"}
]
)
**指定时长、无指定风格**:
```python
result = api.execute_workflow(
diy_story="一个冒险故事...",
aspect="16:9",
project_name="我的视频项目",
video_duration="60"
)指定时长和风格:
python
result = api.execute_workflow(
diy_story="一个冒险故事...",
aspect="16:9",
project_name="我的视频项目",
video_duration="60",
style_id=142
)旁白模式:
python
result = api.execute_workflow(
diy_story="今天我们来聊聊AI的发展...",
aspect="16:9",
project_name="旁白视频",
project_type="narration"
)短片模式:
python
result = api.execute_workflow(
diy_story="日落时分,一位老渔夫独自划着船回家。海面泛着红光...",
aspect="16:9",
project_name="短片",
project_type="short-film"
)包含角色图片(当用户提供角色图片URL时):
python
result = api.execute_workflow(
diy_story="小明和小红在公园相遇,他们相视一笑...",
aspect="16:9",
project_name="自定义角色视频",
character_info=[
{"name": "小明", "url": "https://xxx/xiaoming.jpg"},
{"name": "小红", "url": "https://xxx/xiaohong.jpg"}
]
)Return Value
返回值
The function blocks until the task completes (success or failure) or times out (1 hour). Wait for it to return.
Success (includes download link):
json
{
"code": 200,
"msg": "success",
"uuid": "...",
"data": {
"project_id": "...",
"video_asset": {...},
"status": "completed"
}
}Return the full signed URL to the user (), e.g.:
data.video_asset.download_urlhttps://assets.giggle.pro/private/ai_director/348e4956c7bd4f763b/qzjc7gwkpf.mp4?Policy=...&Key-Pair-Id=...&Signature=...&response-content-disposition=attachmentDo not return unsigned URLs without query params, e.g.:
https://assets.giggle.pro/private/ai_director/348e4956c7bd4f763b/qzjc7gwkpf.mp4Failure:
json
{
"code": -1,
"msg": "Error message",
"data": null
}函数会阻塞直到任务完成(成功或失败)或超时(1小时)。等待其返回结果。
成功(包含下载链接):
json
{
"code": 200,
"msg": "success",
"uuid": "...",
"data": {
"project_id": "...",
"video_asset": {...},
"status": "completed"
}
}向用户返回完整的签名URL(),例如:
data.video_asset.download_urlhttps://assets.giggle.pro/private/ai_director/348e4956c7bd4f763b/qzjc7gwkpf.mp4?Policy=...&Key-Pair-Id=...&Signature=...&response-content-disposition=attachment请勿返回不带查询参数的未签名URL,例如:
https://assets.giggle.pro/private/ai_director/348e4956c7bd4f763b/qzjc7gwkpf.mp4失败:
json
{
"code": -1,
"msg": "Error message",
"data": null
}