@decartai/sdk 0.0.55 → 0.0.57
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 +6 -4
- package/dist/index.d.ts +9 -6
- package/dist/queue/client.d.ts +6 -4
- package/dist/shared/model.d.ts +4 -79
- package/dist/shared/model.js +10 -113
- package/dist/tokens/client.d.ts +29 -0
- package/dist/tokens/client.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,8 +75,9 @@ const client = createDecartClient({
|
|
|
75
75
|
|
|
76
76
|
// Submit and poll automatically
|
|
77
77
|
const result = await client.queue.submitAndPoll({
|
|
78
|
-
model: models.video("lucy-pro-
|
|
79
|
-
prompt: "
|
|
78
|
+
model: models.video("lucy-pro-v2v"),
|
|
79
|
+
prompt: "Make it look like a watercolor painting",
|
|
80
|
+
data: videoFile,
|
|
80
81
|
onStatusChange: (job) => {
|
|
81
82
|
console.log(`Status: ${job.status}`);
|
|
82
83
|
}
|
|
@@ -94,8 +95,9 @@ Or manage the polling manually:
|
|
|
94
95
|
```typescript
|
|
95
96
|
// Submit the job
|
|
96
97
|
const job = await client.queue.submit({
|
|
97
|
-
model: models.video("lucy-pro-
|
|
98
|
-
prompt: "
|
|
98
|
+
model: models.video("lucy-pro-v2v"),
|
|
99
|
+
prompt: "Make it look like a watercolor painting",
|
|
100
|
+
data: videoFile
|
|
99
101
|
});
|
|
100
102
|
console.log(`Job ID: ${job.job_id}`);
|
|
101
103
|
|
package/dist/index.d.ts
CHANGED
|
@@ -67,8 +67,9 @@ declare const createDecartClient: (options?: DecartClientOptions) => {
|
|
|
67
67
|
* ```ts
|
|
68
68
|
* const client = createDecartClient({ apiKey: "your-api-key" });
|
|
69
69
|
* const result = await client.process({
|
|
70
|
-
* model: models.image("lucy-pro-
|
|
71
|
-
* prompt: "
|
|
70
|
+
* model: models.image("lucy-pro-i2i"),
|
|
71
|
+
* prompt: "Transform into anime style",
|
|
72
|
+
* data: imageBlob
|
|
72
73
|
* });
|
|
73
74
|
* ```
|
|
74
75
|
*/
|
|
@@ -84,15 +85,17 @@ declare const createDecartClient: (options?: DecartClientOptions) => {
|
|
|
84
85
|
*
|
|
85
86
|
* // Option 1: Submit and poll automatically
|
|
86
87
|
* const result = await client.queue.submitAndPoll({
|
|
87
|
-
* model: models.video("lucy-pro-
|
|
88
|
-
* prompt: "
|
|
88
|
+
* model: models.video("lucy-pro-v2v"),
|
|
89
|
+
* prompt: "Transform into anime style",
|
|
90
|
+
* data: videoBlob,
|
|
89
91
|
* onStatusChange: (job) => console.log(`Job ${job.job_id}: ${job.status}`)
|
|
90
92
|
* });
|
|
91
93
|
*
|
|
92
94
|
* // Option 2: Submit and poll manually
|
|
93
95
|
* const job = await client.queue.submit({
|
|
94
|
-
* model: models.video("lucy-pro-
|
|
95
|
-
* prompt: "
|
|
96
|
+
* model: models.video("lucy-pro-v2v"),
|
|
97
|
+
* prompt: "Transform into anime style",
|
|
98
|
+
* data: videoBlob
|
|
96
99
|
* });
|
|
97
100
|
*
|
|
98
101
|
* // Poll until completion
|
package/dist/queue/client.d.ts
CHANGED
|
@@ -15,8 +15,9 @@ type QueueClient = {
|
|
|
15
15
|
* @example
|
|
16
16
|
* ```ts
|
|
17
17
|
* const job = await client.queue.submit({
|
|
18
|
-
* model: models.video("lucy-pro-
|
|
19
|
-
* prompt: "
|
|
18
|
+
* model: models.video("lucy-pro-v2v"),
|
|
19
|
+
* prompt: "Make it look like a watercolor painting",
|
|
20
|
+
* data: videoBlob
|
|
20
21
|
* });
|
|
21
22
|
* console.log(job.job_id); // "job_abc123"
|
|
22
23
|
* ```
|
|
@@ -50,8 +51,9 @@ type QueueClient = {
|
|
|
50
51
|
* @example
|
|
51
52
|
* ```ts
|
|
52
53
|
* const result = await client.queue.submitAndPoll({
|
|
53
|
-
* model: models.video("lucy-pro-
|
|
54
|
-
* prompt: "
|
|
54
|
+
* model: models.video("lucy-pro-v2v"),
|
|
55
|
+
* prompt: "Transform into anime style",
|
|
56
|
+
* data: videoBlob,
|
|
55
57
|
* onStatusChange: (job) => {
|
|
56
58
|
* console.log(`Job ${job.job_id}: ${job.status}`);
|
|
57
59
|
* }
|
package/dist/shared/model.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
//#region src/shared/model.d.ts
|
|
4
4
|
declare const realtimeModels: z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">, z.ZodLiteral<"lucy_2_rt">, z.ZodLiteral<"live_avatar">]>;
|
|
5
|
-
declare const videoModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-
|
|
6
|
-
declare const imageModels: z.
|
|
7
|
-
declare const modelSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">, z.ZodLiteral<"lucy_2_rt">, z.ZodLiteral<"live_avatar">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-
|
|
5
|
+
declare const videoModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-motion">, z.ZodLiteral<"lucy-restyle-v2v">, z.ZodLiteral<"lucy-2-v2v">]>;
|
|
6
|
+
declare const imageModels: z.ZodLiteral<"lucy-pro-i2i">;
|
|
7
|
+
declare const modelSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">, z.ZodLiteral<"lucy_2_rt">, z.ZodLiteral<"live_avatar">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-motion">, z.ZodLiteral<"lucy-restyle-v2v">, z.ZodLiteral<"lucy-2-v2v">]>, z.ZodLiteral<"lucy-pro-i2i">]>;
|
|
8
8
|
type Model = z.infer<typeof modelSchema>;
|
|
9
9
|
type RealTimeModels = z.infer<typeof realtimeModels>;
|
|
10
10
|
type VideoModels = z.infer<typeof videoModels>;
|
|
@@ -13,47 +13,6 @@ declare function isRealtimeModel(model: string): model is RealTimeModels;
|
|
|
13
13
|
declare function isVideoModel(model: string): model is VideoModels;
|
|
14
14
|
declare function isImageModel(model: string): model is ImageModels;
|
|
15
15
|
declare const modelInputSchemas: {
|
|
16
|
-
readonly "lucy-pro-t2v": z.ZodObject<{
|
|
17
|
-
prompt: z.ZodString;
|
|
18
|
-
seed: z.ZodOptional<z.ZodNumber>;
|
|
19
|
-
resolution: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
20
|
-
"720p": "720p";
|
|
21
|
-
"480p": "480p";
|
|
22
|
-
}>>>;
|
|
23
|
-
orientation: z.ZodOptional<z.ZodString>;
|
|
24
|
-
}, z.core.$strip>;
|
|
25
|
-
readonly "lucy-pro-t2i": z.ZodObject<{
|
|
26
|
-
prompt: z.ZodString;
|
|
27
|
-
seed: z.ZodOptional<z.ZodNumber>;
|
|
28
|
-
resolution: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
29
|
-
"720p": "720p";
|
|
30
|
-
"480p": "480p";
|
|
31
|
-
}>>>;
|
|
32
|
-
orientation: z.ZodOptional<z.ZodString>;
|
|
33
|
-
}, z.core.$strip>;
|
|
34
|
-
readonly "lucy-pro-i2v": z.ZodObject<{
|
|
35
|
-
prompt: z.ZodString;
|
|
36
|
-
data: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
37
|
-
uri: z.ZodString;
|
|
38
|
-
type: z.ZodString;
|
|
39
|
-
name: z.ZodString;
|
|
40
|
-
}, z.core.$strip>]>;
|
|
41
|
-
seed: z.ZodOptional<z.ZodNumber>;
|
|
42
|
-
resolution: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
43
|
-
"720p": "720p";
|
|
44
|
-
"480p": "480p";
|
|
45
|
-
}>>>;
|
|
46
|
-
}, z.core.$strip>;
|
|
47
|
-
readonly "lucy-dev-i2v": z.ZodObject<{
|
|
48
|
-
prompt: z.ZodString;
|
|
49
|
-
data: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
50
|
-
uri: z.ZodString;
|
|
51
|
-
type: z.ZodString;
|
|
52
|
-
name: z.ZodString;
|
|
53
|
-
}, z.core.$strip>]>;
|
|
54
|
-
seed: z.ZodOptional<z.ZodNumber>;
|
|
55
|
-
resolution: z.ZodOptional<z.ZodDefault<z.ZodLiteral<"720p">>>;
|
|
56
|
-
}, z.core.$strip>;
|
|
57
16
|
readonly "lucy-pro-v2v": z.ZodObject<{
|
|
58
17
|
prompt: z.ZodString;
|
|
59
18
|
data: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
@@ -70,35 +29,6 @@ declare const modelInputSchemas: {
|
|
|
70
29
|
resolution: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"720p">>>;
|
|
71
30
|
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
72
31
|
}, z.core.$strip>;
|
|
73
|
-
readonly "lucy-fast-v2v": z.ZodObject<{
|
|
74
|
-
prompt: z.ZodString;
|
|
75
|
-
data: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
76
|
-
uri: z.ZodString;
|
|
77
|
-
type: z.ZodString;
|
|
78
|
-
name: z.ZodString;
|
|
79
|
-
}, z.core.$strip>]>;
|
|
80
|
-
seed: z.ZodOptional<z.ZodNumber>;
|
|
81
|
-
resolution: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"720p">>>;
|
|
82
|
-
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
-
}, z.core.$strip>;
|
|
84
|
-
readonly "lucy-pro-flf2v": z.ZodObject<{
|
|
85
|
-
prompt: z.ZodString;
|
|
86
|
-
start: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
87
|
-
uri: z.ZodString;
|
|
88
|
-
type: z.ZodString;
|
|
89
|
-
name: z.ZodString;
|
|
90
|
-
}, z.core.$strip>]>;
|
|
91
|
-
end: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
92
|
-
uri: z.ZodString;
|
|
93
|
-
type: z.ZodString;
|
|
94
|
-
name: z.ZodString;
|
|
95
|
-
}, z.core.$strip>]>;
|
|
96
|
-
seed: z.ZodOptional<z.ZodNumber>;
|
|
97
|
-
resolution: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
98
|
-
"720p": "720p";
|
|
99
|
-
"480p": "480p";
|
|
100
|
-
}>>>;
|
|
101
|
-
}, z.core.$strip>;
|
|
102
32
|
readonly "lucy-pro-i2i": z.ZodObject<{
|
|
103
33
|
prompt: z.ZodString;
|
|
104
34
|
data: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
@@ -194,21 +124,16 @@ declare const models: {
|
|
|
194
124
|
* Get a video model identifier.
|
|
195
125
|
*
|
|
196
126
|
* Available options:
|
|
197
|
-
* - `"lucy-pro-t2v"` - Text-to-video
|
|
198
|
-
* - `"lucy-pro-i2v"` - Image-to-video
|
|
199
127
|
* - `"lucy-pro-v2v"` - Video-to-video
|
|
200
|
-
* - `"lucy-pro-flf2v"` - First-last-frame-to-video
|
|
201
|
-
* - `"lucy-dev-i2v"` - Image-to-video (Dev quality)
|
|
202
|
-
* - `"lucy-fast-v2v"` - Video-to-video (Fast quality)
|
|
203
128
|
* - `"lucy-restyle-v2v"` - Video-to-video (Restyling)
|
|
204
129
|
* - `"lucy-2-v2v"` - Video-to-video (Long-form editing, 720p)
|
|
130
|
+
* - `"lucy-motion"` - Motion generation
|
|
205
131
|
*/
|
|
206
132
|
video: <T extends VideoModels>(model: T) => ModelDefinition<T>;
|
|
207
133
|
/**
|
|
208
134
|
* Get an image model identifier.
|
|
209
135
|
*
|
|
210
136
|
* Available options:
|
|
211
|
-
* - `"lucy-pro-t2i"` - Text-to-image
|
|
212
137
|
* - `"lucy-pro-i2i"` - Image-to-image
|
|
213
138
|
*/
|
|
214
139
|
image: <T extends ImageModels>(model: T) => ModelDefinition<T>;
|
package/dist/shared/model.js
CHANGED
|
@@ -10,17 +10,12 @@ const realtimeModels = z.union([
|
|
|
10
10
|
z.literal("live_avatar")
|
|
11
11
|
]);
|
|
12
12
|
const videoModels = z.union([
|
|
13
|
-
z.literal("lucy-dev-i2v"),
|
|
14
|
-
z.literal("lucy-fast-v2v"),
|
|
15
|
-
z.literal("lucy-pro-t2v"),
|
|
16
|
-
z.literal("lucy-pro-i2v"),
|
|
17
13
|
z.literal("lucy-pro-v2v"),
|
|
18
|
-
z.literal("lucy-pro-flf2v"),
|
|
19
14
|
z.literal("lucy-motion"),
|
|
20
15
|
z.literal("lucy-restyle-v2v"),
|
|
21
16
|
z.literal("lucy-2-v2v")
|
|
22
17
|
]);
|
|
23
|
-
const imageModels = z.
|
|
18
|
+
const imageModels = z.literal("lucy-pro-i2i");
|
|
24
19
|
const modelSchema = z.union([
|
|
25
20
|
realtimeModels,
|
|
26
21
|
videoModels,
|
|
@@ -48,10 +43,6 @@ const fileInputSchema = z.union([
|
|
|
48
43
|
})
|
|
49
44
|
]);
|
|
50
45
|
/**
|
|
51
|
-
* Resolution schema for dev models. Supports only 720p.
|
|
52
|
-
*/
|
|
53
|
-
const devResolutionSchema = z.literal("720p").default("720p").optional().describe("The resolution to use for the generation. For dev models, only `720p` is supported.");
|
|
54
|
-
/**
|
|
55
46
|
* Resolution schema for pro models.
|
|
56
47
|
* @param defaultValue - Optional default value (e.g., "720p")
|
|
57
48
|
*/
|
|
@@ -67,30 +58,6 @@ const motionResolutionSchema = z.literal("720p").default("720p").optional().desc
|
|
|
67
58
|
*/
|
|
68
59
|
const proV2vResolutionSchema = z.literal("720p").optional().describe("The resolution to use for the generation").default("720p");
|
|
69
60
|
const modelInputSchemas = {
|
|
70
|
-
"lucy-pro-t2v": z.object({
|
|
71
|
-
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
72
|
-
seed: z.number().optional().describe("The seed to use for the generation"),
|
|
73
|
-
resolution: proResolutionSchema(),
|
|
74
|
-
orientation: z.string().optional().describe("The orientation to use for the generation")
|
|
75
|
-
}),
|
|
76
|
-
"lucy-pro-t2i": z.object({
|
|
77
|
-
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
78
|
-
seed: z.number().optional().describe("The seed to use for the generation"),
|
|
79
|
-
resolution: proResolutionSchema(),
|
|
80
|
-
orientation: z.string().optional().describe("The orientation to use for the generation")
|
|
81
|
-
}),
|
|
82
|
-
"lucy-pro-i2v": z.object({
|
|
83
|
-
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
84
|
-
data: fileInputSchema.describe("The image data to use for generation (File, Blob, ReadableStream, URL, or string URL). Output video is limited to 5 seconds."),
|
|
85
|
-
seed: z.number().optional().describe("The seed to use for the generation"),
|
|
86
|
-
resolution: proResolutionSchema()
|
|
87
|
-
}),
|
|
88
|
-
"lucy-dev-i2v": z.object({
|
|
89
|
-
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
90
|
-
data: fileInputSchema.describe("The image data to use for generation (File, Blob, ReadableStream, URL, or string URL). Output video is limited to 5 seconds."),
|
|
91
|
-
seed: z.number().optional().describe("The seed to use for the generation"),
|
|
92
|
-
resolution: devResolutionSchema
|
|
93
|
-
}),
|
|
94
61
|
"lucy-pro-v2v": z.object({
|
|
95
62
|
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
96
63
|
data: fileInputSchema.describe("The video data to use for generation (File, Blob, ReadableStream, URL, or string URL). Output video is limited to 5 seconds."),
|
|
@@ -99,20 +66,6 @@ const modelInputSchemas = {
|
|
|
99
66
|
resolution: proV2vResolutionSchema,
|
|
100
67
|
enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt")
|
|
101
68
|
}),
|
|
102
|
-
"lucy-fast-v2v": z.object({
|
|
103
|
-
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
104
|
-
data: fileInputSchema.describe("The video data to use for generation (File, Blob, ReadableStream, URL, or string URL). Output video is limited to 5 seconds."),
|
|
105
|
-
seed: z.number().optional().describe("The seed to use for the generation"),
|
|
106
|
-
resolution: proV2vResolutionSchema,
|
|
107
|
-
enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt")
|
|
108
|
-
}),
|
|
109
|
-
"lucy-pro-flf2v": z.object({
|
|
110
|
-
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
111
|
-
start: fileInputSchema.describe("The start frame image (File, Blob, ReadableStream, URL, or string URL)"),
|
|
112
|
-
end: fileInputSchema.describe("The end frame image (File, Blob, ReadableStream, URL, or string URL)"),
|
|
113
|
-
seed: z.number().optional().describe("The seed to use for the generation"),
|
|
114
|
-
resolution: proResolutionSchema()
|
|
115
|
-
}),
|
|
116
69
|
"lucy-pro-i2i": z.object({
|
|
117
70
|
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
118
71
|
data: fileInputSchema.describe("The image data to use for generation (File, Blob, ReadableStream, URL, or string URL)"),
|
|
@@ -199,63 +152,16 @@ const _models = {
|
|
|
199
152
|
inputSchema: z.object({})
|
|
200
153
|
}
|
|
201
154
|
},
|
|
202
|
-
image: {
|
|
203
|
-
"lucy-pro-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
"lucy-pro-i2i": {
|
|
213
|
-
urlPath: "/v1/generate/lucy-pro-i2i",
|
|
214
|
-
queueUrlPath: "/v1/jobs/lucy-pro-i2i",
|
|
215
|
-
name: "lucy-pro-i2i",
|
|
216
|
-
fps: 25,
|
|
217
|
-
width: 1280,
|
|
218
|
-
height: 704,
|
|
219
|
-
inputSchema: modelInputSchemas["lucy-pro-i2i"]
|
|
220
|
-
}
|
|
221
|
-
},
|
|
155
|
+
image: { "lucy-pro-i2i": {
|
|
156
|
+
urlPath: "/v1/generate/lucy-pro-i2i",
|
|
157
|
+
queueUrlPath: "/v1/jobs/lucy-pro-i2i",
|
|
158
|
+
name: "lucy-pro-i2i",
|
|
159
|
+
fps: 25,
|
|
160
|
+
width: 1280,
|
|
161
|
+
height: 704,
|
|
162
|
+
inputSchema: modelInputSchemas["lucy-pro-i2i"]
|
|
163
|
+
} },
|
|
222
164
|
video: {
|
|
223
|
-
"lucy-dev-i2v": {
|
|
224
|
-
urlPath: "/v1/generate/lucy-dev-i2v",
|
|
225
|
-
queueUrlPath: "/v1/jobs/lucy-dev-i2v",
|
|
226
|
-
name: "lucy-dev-i2v",
|
|
227
|
-
fps: 25,
|
|
228
|
-
width: 1280,
|
|
229
|
-
height: 704,
|
|
230
|
-
inputSchema: modelInputSchemas["lucy-dev-i2v"]
|
|
231
|
-
},
|
|
232
|
-
"lucy-fast-v2v": {
|
|
233
|
-
urlPath: "/v1/generate/lucy-fast-v2v",
|
|
234
|
-
queueUrlPath: "/v1/jobs/lucy-fast-v2v",
|
|
235
|
-
name: "lucy-fast-v2v",
|
|
236
|
-
fps: 25,
|
|
237
|
-
width: 1280,
|
|
238
|
-
height: 720,
|
|
239
|
-
inputSchema: modelInputSchemas["lucy-fast-v2v"]
|
|
240
|
-
},
|
|
241
|
-
"lucy-pro-t2v": {
|
|
242
|
-
urlPath: "/v1/generate/lucy-pro-t2v",
|
|
243
|
-
queueUrlPath: "/v1/jobs/lucy-pro-t2v",
|
|
244
|
-
name: "lucy-pro-t2v",
|
|
245
|
-
fps: 25,
|
|
246
|
-
width: 1280,
|
|
247
|
-
height: 704,
|
|
248
|
-
inputSchema: modelInputSchemas["lucy-pro-t2v"]
|
|
249
|
-
},
|
|
250
|
-
"lucy-pro-i2v": {
|
|
251
|
-
urlPath: "/v1/generate/lucy-pro-i2v",
|
|
252
|
-
queueUrlPath: "/v1/jobs/lucy-pro-i2v",
|
|
253
|
-
name: "lucy-pro-i2v",
|
|
254
|
-
fps: 25,
|
|
255
|
-
width: 1280,
|
|
256
|
-
height: 704,
|
|
257
|
-
inputSchema: modelInputSchemas["lucy-pro-i2v"]
|
|
258
|
-
},
|
|
259
165
|
"lucy-pro-v2v": {
|
|
260
166
|
urlPath: "/v1/generate/lucy-pro-v2v",
|
|
261
167
|
queueUrlPath: "/v1/jobs/lucy-pro-v2v",
|
|
@@ -265,15 +171,6 @@ const _models = {
|
|
|
265
171
|
height: 704,
|
|
266
172
|
inputSchema: modelInputSchemas["lucy-pro-v2v"]
|
|
267
173
|
},
|
|
268
|
-
"lucy-pro-flf2v": {
|
|
269
|
-
urlPath: "/v1/generate/lucy-pro-flf2v",
|
|
270
|
-
queueUrlPath: "/v1/jobs/lucy-pro-flf2v",
|
|
271
|
-
name: "lucy-pro-flf2v",
|
|
272
|
-
fps: 25,
|
|
273
|
-
width: 1280,
|
|
274
|
-
height: 704,
|
|
275
|
-
inputSchema: modelInputSchemas["lucy-pro-flf2v"]
|
|
276
|
-
},
|
|
277
174
|
"lucy-motion": {
|
|
278
175
|
urlPath: "/v1/generate/lucy-motion",
|
|
279
176
|
queueUrlPath: "/v1/jobs/lucy-motion",
|
package/dist/tokens/client.d.ts
CHANGED
|
@@ -1,12 +1,34 @@
|
|
|
1
|
+
import { Model } from "../shared/model.js";
|
|
2
|
+
|
|
1
3
|
//#region src/tokens/client.d.ts
|
|
2
4
|
|
|
3
5
|
type CreateTokenOptions = {
|
|
4
6
|
/** Custom key-value pairs to attach to the client token. */
|
|
5
7
|
metadata?: Record<string, unknown>;
|
|
8
|
+
/** Seconds until the token expires (1-3600, default 60). */
|
|
9
|
+
expiresIn?: number;
|
|
10
|
+
/** Restrict which models this token can access (max 20 items). */
|
|
11
|
+
allowedModels?: (Model | (string & {}))[];
|
|
12
|
+
/** Operational limits for the token. */
|
|
13
|
+
constraints?: {
|
|
14
|
+
realtime?: {
|
|
15
|
+
maxSessionDuration?: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
6
18
|
};
|
|
7
19
|
type CreateTokenResponse = {
|
|
8
20
|
apiKey: string;
|
|
9
21
|
expiresAt: string;
|
|
22
|
+
/** Present when `allowedModels` was set on the request. */
|
|
23
|
+
permissions?: {
|
|
24
|
+
models: (Model | (string & {}))[];
|
|
25
|
+
} | null;
|
|
26
|
+
/** Present when `constraints` was set on the request. */
|
|
27
|
+
constraints?: {
|
|
28
|
+
realtime?: {
|
|
29
|
+
maxSessionDuration?: number;
|
|
30
|
+
};
|
|
31
|
+
} | null;
|
|
10
32
|
};
|
|
11
33
|
type TokensClient = {
|
|
12
34
|
/**
|
|
@@ -22,6 +44,13 @@ type TokensClient = {
|
|
|
22
44
|
*
|
|
23
45
|
* // With metadata:
|
|
24
46
|
* const token = await client.tokens.create({ metadata: { role: "viewer" } });
|
|
47
|
+
*
|
|
48
|
+
* // With expiry, model restrictions, and constraints:
|
|
49
|
+
* const token = await client.tokens.create({
|
|
50
|
+
* expiresIn: 300,
|
|
51
|
+
* allowedModels: ["lucy-pro-v2v", "lucy-restyle-v2v"],
|
|
52
|
+
* constraints: { realtime: { maxSessionDuration: 120 } },
|
|
53
|
+
* });
|
|
25
54
|
* ```
|
|
26
55
|
*/
|
|
27
56
|
create: (options?: CreateTokenOptions) => Promise<CreateTokenResponse>;
|
package/dist/tokens/client.js
CHANGED
|
@@ -15,7 +15,7 @@ const createTokensClient = (opts) => {
|
|
|
15
15
|
const response = await fetch(`${baseUrl}/v1/client/tokens`, {
|
|
16
16
|
method: "POST",
|
|
17
17
|
headers,
|
|
18
|
-
body: JSON.stringify(options
|
|
18
|
+
body: JSON.stringify(options ?? {})
|
|
19
19
|
});
|
|
20
20
|
if (!response.ok) {
|
|
21
21
|
const errorText = await response.text().catch(() => "Unknown error");
|