@unityclaw/skills 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +125 -0
- package/dist/chunk-KHQZYC3Y.js +163 -0
- package/dist/cli.cjs +237 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +69 -0
- package/dist/index.cjs +197 -0
- package/dist/index.d.cts +36 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +18 -0
- package/package.json +59 -0
- package/unityclaw-document-convert/SKILL.md +375 -0
- package/unityclaw-document-translation/SKILL.md +273 -0
- package/unityclaw-image-compress/SKILL.md +229 -0
- package/unityclaw-image-generation/SKILL.md +213 -0
- package/unityclaw-media-analysis/SKILL.md +315 -0
- package/unityclaw-video-generation-kling/SKILL.md +233 -0
- package/unityclaw-video-generation-other/SKILL.md +284 -0
- package/unityclaw-video-generation-sora/SKILL.md +250 -0
- package/unityclaw-video-generation-veo/SKILL.md +239 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: unityclaw-media-analysis
|
|
3
|
+
description: Analyze video and audio content to extract subtitles, summaries, and insights
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
metadata:
|
|
6
|
+
openclaw:
|
|
7
|
+
requires:
|
|
8
|
+
env:
|
|
9
|
+
- UNITYCLAW_API_KEY
|
|
10
|
+
bins:
|
|
11
|
+
- node
|
|
12
|
+
- npm
|
|
13
|
+
primaryEnv: UNITYCLAW_API_KEY
|
|
14
|
+
emoji: "📊"
|
|
15
|
+
homepage: https://unityclaw.com
|
|
16
|
+
install:
|
|
17
|
+
- kind: node
|
|
18
|
+
package: "@unityclaw/sdk"
|
|
19
|
+
bins: []
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# UnityClaw Media Analysis
|
|
23
|
+
|
|
24
|
+
Analyze video and audio content to extract subtitles, summaries, and insights from various sources.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @unityclaw/sdk
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Configuration
|
|
33
|
+
|
|
34
|
+
Set your API key as environment variable:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
export UNITYCLAW_API_KEY=your-api-key
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { UnityClawClient } from '@unityclaw/sdk';
|
|
44
|
+
|
|
45
|
+
const client = new UnityClawClient();
|
|
46
|
+
|
|
47
|
+
// Analyze from URL
|
|
48
|
+
const result = await client.media.analyze({
|
|
49
|
+
url: [{ link: 'https://youtube.com/watch?v=...' }]
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
if (result.code === 0) {
|
|
53
|
+
console.log('Summary:', result.data?.summary);
|
|
54
|
+
console.log('Subtitle:', result.data?.subtitle);
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Available APIs
|
|
59
|
+
|
|
60
|
+
### analyze()
|
|
61
|
+
|
|
62
|
+
Analyze media from URL or uploaded file.
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
await client.media.analyze({
|
|
66
|
+
url: Array<{ tmp_url?: string; link?: string; text?: string; type?: string }>
|
|
67
|
+
}): Promise<APIResponse<MediaAnalysisResult>>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### analyzeVideo()
|
|
71
|
+
|
|
72
|
+
Analyze a video file directly.
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
await client.media.analyzeVideo({
|
|
76
|
+
file: { tmp_url: string; type?: string; name?: string; size?: number };
|
|
77
|
+
prompt?: string;
|
|
78
|
+
}): Promise<APIResponse<MediaAnalysisResult>>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### analyzeSocialVideo()
|
|
82
|
+
|
|
83
|
+
Analyze social media videos (TikTok, YouTube, etc.).
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
await client.media.analyzeSocialVideo({
|
|
87
|
+
url: string;
|
|
88
|
+
}): Promise<APIResponse<MediaAnalysisResult>>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Parameters
|
|
92
|
+
|
|
93
|
+
### MediaAnalysisParams
|
|
94
|
+
|
|
95
|
+
| Parameter | Type | Required | Description |
|
|
96
|
+
|-----------|------|----------|-------------|
|
|
97
|
+
| `url` | `Array` | Yes | Array of media sources |
|
|
98
|
+
|
|
99
|
+
### URL Item Properties
|
|
100
|
+
|
|
101
|
+
| Property | Type | Description |
|
|
102
|
+
|----------|------|-------------|
|
|
103
|
+
| `tmp_url` | `string` | Uploaded file URL |
|
|
104
|
+
| `link` | `string` | External URL (YouTube, TikTok, etc.) |
|
|
105
|
+
| `text` | `string` | Text description |
|
|
106
|
+
| `type` | `string` | MIME type or 'url' |
|
|
107
|
+
|
|
108
|
+
### VideoAnalysisParams
|
|
109
|
+
|
|
110
|
+
| Parameter | Type | Required | Description |
|
|
111
|
+
|-----------|------|----------|-------------|
|
|
112
|
+
| `file` | `object` | Yes | Video file info |
|
|
113
|
+
| `prompt` | `string` | No | Custom analysis prompt |
|
|
114
|
+
|
|
115
|
+
## Response Format
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
interface MediaAnalysisResult {
|
|
119
|
+
summary: string; // Content summary
|
|
120
|
+
subtitle: string; // Extracted subtitles/transcript
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Examples
|
|
125
|
+
|
|
126
|
+
### YouTube Video Analysis
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
const client = new UnityClawClient();
|
|
130
|
+
|
|
131
|
+
const result = await client.media.analyze({
|
|
132
|
+
url: [{ link: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' }]
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
if (result.code === 0 && result.data) {
|
|
136
|
+
console.log('Summary:', result.data.summary);
|
|
137
|
+
console.log('Transcript:', result.data.subtitle);
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### TikTok Video Analysis
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
const result = await client.media.analyzeSocialVideo({
|
|
145
|
+
url: 'https://www.tiktok.com/@user/video/123456789'
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
if (result.code === 0 && result.data) {
|
|
149
|
+
console.log('Content:', result.data.summary);
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Uploaded Video Analysis
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
const result = await client.media.analyzeVideo({
|
|
157
|
+
file: {
|
|
158
|
+
tmp_url: 'https://example.com/uploaded-video.mp4',
|
|
159
|
+
type: 'video/mp4',
|
|
160
|
+
name: 'meeting-recording.mp4'
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
if (result.code === 0 && result.data) {
|
|
165
|
+
console.log('Meeting summary:', result.data.summary);
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Custom Analysis Prompt
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
const result = await client.media.analyzeVideo({
|
|
173
|
+
file: {
|
|
174
|
+
tmp_url: 'https://example.com/tutorial.mp4',
|
|
175
|
+
name: 'tutorial.mp4'
|
|
176
|
+
},
|
|
177
|
+
prompt: 'Extract all code snippets and programming concepts mentioned in this tutorial'
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
if (result.code === 0 && result.data) {
|
|
181
|
+
console.log('Analysis:', result.data.summary);
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Multiple Videos Analysis
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
const videos = [
|
|
189
|
+
{ link: 'https://youtube.com/watch?v=video1' },
|
|
190
|
+
{ link: 'https://youtube.com/watch?v=video2' },
|
|
191
|
+
{ link: 'https://youtube.com/watch?v=video3' }
|
|
192
|
+
];
|
|
193
|
+
|
|
194
|
+
const results = await Promise.all(
|
|
195
|
+
videos.map(video => client.media.analyze({ url: [video] }))
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
results.forEach((result, i) => {
|
|
199
|
+
if (result.code === 0) {
|
|
200
|
+
console.log(`Video ${i + 1}:`, result.data?.summary);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Audio File Analysis
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
const result = await client.media.analyze({
|
|
209
|
+
url: [
|
|
210
|
+
{
|
|
211
|
+
tmp_url: 'https://example.com/podcast.mp3',
|
|
212
|
+
type: 'audio/mpeg',
|
|
213
|
+
name: 'podcast.mp3'
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
if (result.code === 0 && result.data) {
|
|
219
|
+
console.log('Podcast summary:', result.data.summary);
|
|
220
|
+
console.log('Transcript:', result.data.subtitle);
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Meeting Recording Analysis
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
const result = await client.media.analyzeVideo({
|
|
228
|
+
file: {
|
|
229
|
+
tmp_url: 'https://example.com/meeting.mp4',
|
|
230
|
+
name: 'team-meeting.mp4'
|
|
231
|
+
},
|
|
232
|
+
prompt: 'Extract action items, decisions made, and key discussion points'
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
if (result.code === 0 && result.data) {
|
|
236
|
+
console.log('Meeting Notes:', result.data.summary);
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Lecture/Educational Content
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
const result = await client.media.analyze({
|
|
244
|
+
url: [{ link: 'https://youtube.com/watch?v=lecture-id' }]
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
if (result.code === 0 && result.data) {
|
|
248
|
+
console.log('Lecture Summary:', result.data.summary);
|
|
249
|
+
console.log('Full Transcript:', result.data.subtitle);
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Supported Platforms
|
|
254
|
+
|
|
255
|
+
| Platform | URL Format |
|
|
256
|
+
|----------|------------|
|
|
257
|
+
| YouTube | `youtube.com/watch?v=*` |
|
|
258
|
+
| TikTok | `tiktok.com/@user/video/*` |
|
|
259
|
+
| Vimeo | `vimeo.com/*` |
|
|
260
|
+
| Twitter/X | `twitter.com/*/status/*` |
|
|
261
|
+
| Direct Video | Any direct video URL |
|
|
262
|
+
|
|
263
|
+
## Supported Media Types
|
|
264
|
+
|
|
265
|
+
- Video: MP4, WebM, MOV, AVI
|
|
266
|
+
- Audio: MP3, WAV, M4A, AAC
|
|
267
|
+
- Streaming: YouTube, TikTok, Vimeo
|
|
268
|
+
|
|
269
|
+
## Error Handling
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
const result = await client.media.analyze({
|
|
273
|
+
url: [{ link: 'https://youtube.com/watch?v=invalid' }]
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
if (result.code !== 0) {
|
|
277
|
+
console.error('Analysis failed:', result.msg);
|
|
278
|
+
} else {
|
|
279
|
+
console.log('Success:', result.data);
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Task Folders
|
|
284
|
+
|
|
285
|
+
Each execution creates a task folder:
|
|
286
|
+
|
|
287
|
+
```typescript
|
|
288
|
+
const result = await client.media.analyze({
|
|
289
|
+
url: [{ link: 'https://youtube.com/watch?v=...' }]
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
console.log('Task ID:', result.taskId);
|
|
293
|
+
console.log('Task Folder:', result.taskFolder);
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
## Use Cases
|
|
297
|
+
|
|
298
|
+
1. **Content Summarization**: Get quick summaries of long videos
|
|
299
|
+
2. **Transcription**: Extract subtitles/transcripts from videos
|
|
300
|
+
3. **Meeting Notes**: Summarize meeting recordings
|
|
301
|
+
4. **Content Analysis**: Analyze social media content
|
|
302
|
+
5. **Educational**: Create study notes from lectures
|
|
303
|
+
6. **Research**: Extract information from video sources
|
|
304
|
+
|
|
305
|
+
## Best Practices
|
|
306
|
+
|
|
307
|
+
1. **URL Quality**: Use high-quality video sources
|
|
308
|
+
2. **Custom Prompts**: Use specific prompts for targeted analysis
|
|
309
|
+
3. **Audio Quality**: Clear audio produces better transcripts
|
|
310
|
+
4. **Batch Processing**: Process multiple videos in parallel
|
|
311
|
+
|
|
312
|
+
## Related Skills
|
|
313
|
+
|
|
314
|
+
- [unityclaw-document-translation](../unityclaw-document-translation/SKILL.md) - Translate transcripts
|
|
315
|
+
- [unityclaw-video-generation-sora](../unityclaw-video-generation-sora/SKILL.md) - Generate videos
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: unityclaw-video-generation-kling
|
|
3
|
+
description: Generate AI videos using Kling model with multi-version support
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
metadata:
|
|
6
|
+
openclaw:
|
|
7
|
+
requires:
|
|
8
|
+
env:
|
|
9
|
+
- UNITYCLAW_API_KEY
|
|
10
|
+
bins:
|
|
11
|
+
- node
|
|
12
|
+
- npm
|
|
13
|
+
primaryEnv: UNITYCLAW_API_KEY
|
|
14
|
+
emoji: "📹"
|
|
15
|
+
homepage: https://unityclaw.com
|
|
16
|
+
install:
|
|
17
|
+
- kind: node
|
|
18
|
+
package: "@unityclaw/sdk"
|
|
19
|
+
bins: []
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# UnityClaw Video Generation - Kling
|
|
23
|
+
|
|
24
|
+
Generate AI videos using the Kling model with support for multiple versions and flexible configuration.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @unityclaw/sdk
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Configuration
|
|
33
|
+
|
|
34
|
+
Set your API key as environment variable:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
export UNITYCLAW_API_KEY=your-api-key
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { UnityClawClient } from '@unityclaw/sdk';
|
|
44
|
+
|
|
45
|
+
const client = new UnityClawClient();
|
|
46
|
+
|
|
47
|
+
const result = await client.video.kling({
|
|
48
|
+
prompt: 'A dog running happily through a sunny park',
|
|
49
|
+
aspect_ratio: { value: '16:9', label: '16:9' },
|
|
50
|
+
duration: { value: '5', label: '5s' }
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
if (result.code === 0) {
|
|
54
|
+
console.log('Generated video:', result.data);
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## API Reference
|
|
59
|
+
|
|
60
|
+
### kling()
|
|
61
|
+
|
|
62
|
+
Generate video using Kling AI model.
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
await client.video.kling({
|
|
66
|
+
attachment?: AttachmentFieldItem[];
|
|
67
|
+
prompt?: string | TextFieldItem[];
|
|
68
|
+
aspect_ratio?: LabelFieldItem | string;
|
|
69
|
+
duration?: LabelFieldItem | string;
|
|
70
|
+
model?: LabelFieldItem | string;
|
|
71
|
+
}): Promise<APIResponse<AttachmentResult[]>>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Parameters
|
|
75
|
+
|
|
76
|
+
| Parameter | Type | Required | Description |
|
|
77
|
+
|-----------|------|----------|-------------|
|
|
78
|
+
| `prompt` | `string \| TextFieldItem[]` | No* | Text description (*required if no attachment) |
|
|
79
|
+
| `attachment` | `AttachmentFieldItem[]` | No* | Reference image (*required if no prompt) |
|
|
80
|
+
| `aspect_ratio` | `LabelFieldItem \| string` | No | Video aspect ratio |
|
|
81
|
+
| `duration` | `LabelFieldItem \| string` | No | Video duration |
|
|
82
|
+
| `model` | `LabelFieldItem \| string` | No | Kling model version |
|
|
83
|
+
|
|
84
|
+
## Examples
|
|
85
|
+
|
|
86
|
+
### Text-to-Video
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
const client = new UnityClawClient();
|
|
90
|
+
|
|
91
|
+
const result = await client.video.kling({
|
|
92
|
+
prompt: 'A cinematic shot of a rocket launching into space with smoke and fire',
|
|
93
|
+
aspect_ratio: { value: '16:9', label: '16:9' },
|
|
94
|
+
duration: { value: '5', label: '5s' },
|
|
95
|
+
model: { value: 'kling-v1', label: 'V1' }
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Image-to-Video
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
const result = await client.video.kling({
|
|
103
|
+
attachment: [
|
|
104
|
+
{ tmp_url: 'https://example.com/portrait.jpg', name: 'portrait.jpg' }
|
|
105
|
+
],
|
|
106
|
+
prompt: 'Bring this portrait to life with subtle animation',
|
|
107
|
+
aspect_ratio: { value: '9:16', label: '9:16' },
|
|
108
|
+
duration: { value: '5', label: '5s' }
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Different Model Versions
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
// Using V1 model
|
|
116
|
+
const result = await client.video.kling({
|
|
117
|
+
prompt: 'A peaceful lake at sunset',
|
|
118
|
+
model: { value: 'kling-v1', label: 'V1' }
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
// Using latest model
|
|
122
|
+
const result = await client.video.kling({
|
|
123
|
+
prompt: 'A futuristic city with flying cars',
|
|
124
|
+
model: { value: 'kling-v2', label: 'V2' }
|
|
125
|
+
});
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Simple String Parameters
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
// Use simple strings for quick calls
|
|
132
|
+
const result = await client.video.kling({
|
|
133
|
+
prompt: 'A cat chasing a butterfly in a meadow',
|
|
134
|
+
aspect_ratio: '16:9',
|
|
135
|
+
duration: '5',
|
|
136
|
+
model: 'kling-v1'
|
|
137
|
+
});
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Portrait for Social Media
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
const result = await client.video.kling({
|
|
144
|
+
prompt: 'A fashion model walking through a stylish boutique',
|
|
145
|
+
aspect_ratio: { value: '9:16', label: '9:16' },
|
|
146
|
+
duration: { value: '5', label: '5s' }
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Long Duration Video
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
const result = await client.video.kling({
|
|
154
|
+
prompt: 'A time-lapse of clouds moving over a mountain range',
|
|
155
|
+
aspect_ratio: { value: '16:9', label: '16:9' },
|
|
156
|
+
duration: { value: '10', label: '10s' }
|
|
157
|
+
});
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Aspect Ratio Options
|
|
161
|
+
|
|
162
|
+
| Value | Use Case |
|
|
163
|
+
|-------|----------|
|
|
164
|
+
| `16:9` | Standard landscape |
|
|
165
|
+
| `9:16` | Portrait (social media) |
|
|
166
|
+
| `1:1` | Square format |
|
|
167
|
+
|
|
168
|
+
## Duration Options
|
|
169
|
+
|
|
170
|
+
| Value | Description |
|
|
171
|
+
|-------|-------------|
|
|
172
|
+
| `5` | 5 seconds (default) |
|
|
173
|
+
| `10` | 10 seconds |
|
|
174
|
+
|
|
175
|
+
## Model Options
|
|
176
|
+
|
|
177
|
+
| Value | Description |
|
|
178
|
+
|-------|-------------|
|
|
179
|
+
| `kling-v1` | Kling V1 model |
|
|
180
|
+
| `kling-v2` | Kling V2 model (latest) |
|
|
181
|
+
|
|
182
|
+
## Response Format
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
interface AttachmentResult {
|
|
186
|
+
name: string;
|
|
187
|
+
contentType: 'attachment/url';
|
|
188
|
+
content: string; // URL to generated video
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Error Handling
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
const result = await client.video.kling({
|
|
196
|
+
prompt: 'A test video',
|
|
197
|
+
aspect_ratio: '16:9'
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
if (result.code !== 0) {
|
|
201
|
+
console.error('Video generation failed:', result.msg);
|
|
202
|
+
} else {
|
|
203
|
+
console.log('Success:', result.data);
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Task Folders
|
|
208
|
+
|
|
209
|
+
Each execution creates a task folder:
|
|
210
|
+
|
|
211
|
+
```typescript
|
|
212
|
+
const result = await client.video.kling({
|
|
213
|
+
prompt: 'test',
|
|
214
|
+
aspect_ratio: '16:9'
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
console.log('Task ID:', result.taskId);
|
|
218
|
+
console.log('Task Folder:', result.taskFolder);
|
|
219
|
+
console.log('Downloaded Videos:', result.attachments);
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Best Practices
|
|
223
|
+
|
|
224
|
+
1. **Model Selection**: Use V2 for better quality, V1 for faster generation
|
|
225
|
+
2. **Image Quality**: Use high-resolution images for image-to-video
|
|
226
|
+
3. **Prompt Detail**: Include camera movement and style descriptions
|
|
227
|
+
4. **Duration**: Balance between content needs and generation time
|
|
228
|
+
|
|
229
|
+
## Related Skills
|
|
230
|
+
|
|
231
|
+
- [unityclaw-video-generation-sora](../unityclaw-video-generation-sora/SKILL.md) - OpenAI Sora
|
|
232
|
+
- [unityclaw-video-generation-veo](../unityclaw-video-generation-veo/SKILL.md) - Google Veo
|
|
233
|
+
- [unityclaw-video-generation-other](../unityclaw-video-generation-other/SKILL.md) - Other video models
|