返回 AiToEarn
grok.interface.ts
根目录 / project / aitoearn-backend / apps / aitoearn-ai / src / core / ai / libs / grok / grok.interface.ts
1 export enum GrokVideoTaskStatus {
2 Pending = 'pending',
3 Done = 'done',
4 Failed = 'failed',
5 Expired = 'expired',
6 }
7
8 export type GrokAspectRatio = '1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '3:2' | '2:3'
9
10 export type GrokResolution = '480p' | '720p'
11
12 export interface GrokCreateVideoRequest {
13 model: string
14 prompt: string
15 duration?: number // 1-15s
16 aspect_ratio?: GrokAspectRatio
17 resolution?: GrokResolution
18 image?: {
19 url: string
20 }
21 reference_images?: Array<{
22 url: string
23 }>
24 }
25
26 export interface GrokEditVideoRequest {
27 model: string
28 prompt: string
29 video: {
30 url: string
31 }
32 }
33
34 export interface GrokCreateVideoResponse {
35 request_id: string
36 }
37
38 export interface GrokGetVideoStatusResponse {
39 request_id?: string
40 status?: GrokVideoTaskStatus
41 model?: string
42 video?: {
43 url: string
44 duration: number
45 respect_moderation: boolean
46 }
47 error?: {
48 code: string
49 message: string
50 }
51 }
52
52 lines TYPESCRIPT