@decartai/sdk 0.0.56 → 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 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-t2v"),
79
- prompt: "A cat playing piano",
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-t2v"),
98
- prompt: "A cat playing piano"
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-t2i"),
71
- * prompt: "A beautiful sunset over the ocean"
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-t2v"),
88
- * prompt: "A beautiful sunset over the ocean",
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-t2v"),
95
- * prompt: "A beautiful sunset over the ocean"
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
@@ -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-t2v"),
19
- * prompt: "A cat playing piano"
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-t2v"),
54
- * prompt: "A beautiful sunset",
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
  * }
@@ -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-dev-i2v">, z.ZodLiteral<"lucy-fast-v2v">, z.ZodLiteral<"lucy-pro-t2v">, z.ZodLiteral<"lucy-pro-i2v">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-motion">, z.ZodLiteral<"lucy-restyle-v2v">, z.ZodLiteral<"lucy-2-v2v">]>;
6
- declare const imageModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-pro-t2i">, 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-dev-i2v">, z.ZodLiteral<"lucy-fast-v2v">, z.ZodLiteral<"lucy-pro-t2v">, z.ZodLiteral<"lucy-pro-i2v">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-motion">, z.ZodLiteral<"lucy-restyle-v2v">, z.ZodLiteral<"lucy-2-v2v">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-pro-t2i">, z.ZodLiteral<"lucy-pro-i2i">]>]>;
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,17 +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
32
  readonly "lucy-pro-i2i": z.ZodObject<{
85
33
  prompt: z.ZodString;
86
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<{
@@ -176,20 +124,16 @@ declare const models: {
176
124
  * Get a video model identifier.
177
125
  *
178
126
  * Available options:
179
- * - `"lucy-pro-t2v"` - Text-to-video
180
- * - `"lucy-pro-i2v"` - Image-to-video
181
127
  * - `"lucy-pro-v2v"` - Video-to-video
182
- * - `"lucy-dev-i2v"` - Image-to-video (Dev quality)
183
- * - `"lucy-fast-v2v"` - Video-to-video (Fast quality)
184
128
  * - `"lucy-restyle-v2v"` - Video-to-video (Restyling)
185
129
  * - `"lucy-2-v2v"` - Video-to-video (Long-form editing, 720p)
130
+ * - `"lucy-motion"` - Motion generation
186
131
  */
187
132
  video: <T extends VideoModels>(model: T) => ModelDefinition<T>;
188
133
  /**
189
134
  * Get an image model identifier.
190
135
  *
191
136
  * Available options:
192
- * - `"lucy-pro-t2i"` - Text-to-image
193
137
  * - `"lucy-pro-i2i"` - Image-to-image
194
138
  */
195
139
  image: <T extends ImageModels>(model: T) => ModelDefinition<T>;
@@ -10,16 +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
14
  z.literal("lucy-motion"),
19
15
  z.literal("lucy-restyle-v2v"),
20
16
  z.literal("lucy-2-v2v")
21
17
  ]);
22
- const imageModels = z.union([z.literal("lucy-pro-t2i"), z.literal("lucy-pro-i2i")]);
18
+ const imageModels = z.literal("lucy-pro-i2i");
23
19
  const modelSchema = z.union([
24
20
  realtimeModels,
25
21
  videoModels,
@@ -47,10 +43,6 @@ const fileInputSchema = z.union([
47
43
  })
48
44
  ]);
49
45
  /**
50
- * Resolution schema for dev models. Supports only 720p.
51
- */
52
- const devResolutionSchema = z.literal("720p").default("720p").optional().describe("The resolution to use for the generation. For dev models, only `720p` is supported.");
53
- /**
54
46
  * Resolution schema for pro models.
55
47
  * @param defaultValue - Optional default value (e.g., "720p")
56
48
  */
@@ -66,30 +58,6 @@ const motionResolutionSchema = z.literal("720p").default("720p").optional().desc
66
58
  */
67
59
  const proV2vResolutionSchema = z.literal("720p").optional().describe("The resolution to use for the generation").default("720p");
68
60
  const modelInputSchemas = {
69
- "lucy-pro-t2v": z.object({
70
- prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
71
- seed: z.number().optional().describe("The seed to use for the generation"),
72
- resolution: proResolutionSchema(),
73
- orientation: z.string().optional().describe("The orientation to use for the generation")
74
- }),
75
- "lucy-pro-t2i": z.object({
76
- prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
77
- seed: z.number().optional().describe("The seed to use for the generation"),
78
- resolution: proResolutionSchema(),
79
- orientation: z.string().optional().describe("The orientation to use for the generation")
80
- }),
81
- "lucy-pro-i2v": z.object({
82
- prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
83
- data: fileInputSchema.describe("The image data to use for generation (File, Blob, ReadableStream, URL, or string URL). Output video is limited to 5 seconds."),
84
- seed: z.number().optional().describe("The seed to use for the generation"),
85
- resolution: proResolutionSchema()
86
- }),
87
- "lucy-dev-i2v": z.object({
88
- prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
89
- data: fileInputSchema.describe("The image data to use for generation (File, Blob, ReadableStream, URL, or string URL). Output video is limited to 5 seconds."),
90
- seed: z.number().optional().describe("The seed to use for the generation"),
91
- resolution: devResolutionSchema
92
- }),
93
61
  "lucy-pro-v2v": z.object({
94
62
  prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
95
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."),
@@ -98,13 +66,6 @@ const modelInputSchemas = {
98
66
  resolution: proV2vResolutionSchema,
99
67
  enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt")
100
68
  }),
101
- "lucy-fast-v2v": z.object({
102
- prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
103
- data: fileInputSchema.describe("The video data to use for generation (File, Blob, ReadableStream, URL, or string URL). Output video is limited to 5 seconds."),
104
- seed: z.number().optional().describe("The seed to use for the generation"),
105
- resolution: proV2vResolutionSchema,
106
- enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt")
107
- }),
108
69
  "lucy-pro-i2i": z.object({
109
70
  prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
110
71
  data: fileInputSchema.describe("The image data to use for generation (File, Blob, ReadableStream, URL, or string URL)"),
@@ -191,63 +152,16 @@ const _models = {
191
152
  inputSchema: z.object({})
192
153
  }
193
154
  },
194
- image: {
195
- "lucy-pro-t2i": {
196
- urlPath: "/v1/generate/lucy-pro-t2i",
197
- queueUrlPath: "/v1/jobs/lucy-pro-t2i",
198
- name: "lucy-pro-t2i",
199
- fps: 25,
200
- width: 1280,
201
- height: 704,
202
- inputSchema: modelInputSchemas["lucy-pro-t2i"]
203
- },
204
- "lucy-pro-i2i": {
205
- urlPath: "/v1/generate/lucy-pro-i2i",
206
- queueUrlPath: "/v1/jobs/lucy-pro-i2i",
207
- name: "lucy-pro-i2i",
208
- fps: 25,
209
- width: 1280,
210
- height: 704,
211
- inputSchema: modelInputSchemas["lucy-pro-i2i"]
212
- }
213
- },
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
+ } },
214
164
  video: {
215
- "lucy-dev-i2v": {
216
- urlPath: "/v1/generate/lucy-dev-i2v",
217
- queueUrlPath: "/v1/jobs/lucy-dev-i2v",
218
- name: "lucy-dev-i2v",
219
- fps: 25,
220
- width: 1280,
221
- height: 704,
222
- inputSchema: modelInputSchemas["lucy-dev-i2v"]
223
- },
224
- "lucy-fast-v2v": {
225
- urlPath: "/v1/generate/lucy-fast-v2v",
226
- queueUrlPath: "/v1/jobs/lucy-fast-v2v",
227
- name: "lucy-fast-v2v",
228
- fps: 25,
229
- width: 1280,
230
- height: 720,
231
- inputSchema: modelInputSchemas["lucy-fast-v2v"]
232
- },
233
- "lucy-pro-t2v": {
234
- urlPath: "/v1/generate/lucy-pro-t2v",
235
- queueUrlPath: "/v1/jobs/lucy-pro-t2v",
236
- name: "lucy-pro-t2v",
237
- fps: 25,
238
- width: 1280,
239
- height: 704,
240
- inputSchema: modelInputSchemas["lucy-pro-t2v"]
241
- },
242
- "lucy-pro-i2v": {
243
- urlPath: "/v1/generate/lucy-pro-i2v",
244
- queueUrlPath: "/v1/jobs/lucy-pro-i2v",
245
- name: "lucy-pro-i2v",
246
- fps: 25,
247
- width: 1280,
248
- height: 704,
249
- inputSchema: modelInputSchemas["lucy-pro-i2v"]
250
- },
251
165
  "lucy-pro-v2v": {
252
166
  urlPath: "/v1/generate/lucy-pro-v2v",
253
167
  queueUrlPath: "/v1/jobs/lucy-pro-v2v",
@@ -48,7 +48,7 @@ type TokensClient = {
48
48
  * // With expiry, model restrictions, and constraints:
49
49
  * const token = await client.tokens.create({
50
50
  * expiresIn: 300,
51
- * allowedModels: ["lucy-pro-t2v", "lucy-pro-i2v"],
51
+ * allowedModels: ["lucy-pro-v2v", "lucy-restyle-v2v"],
52
52
  * constraints: { realtime: { maxSessionDuration: 120 } },
53
53
  * });
54
54
  * ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decartai/sdk",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "description": "Decart's JavaScript SDK",
5
5
  "type": "module",
6
6
  "license": "MIT",