@ai-sdk/luma 3.0.0-beta.3 → 3.0.0-beta.31
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/CHANGELOG.md +247 -8
- package/README.md +2 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +132 -121
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/index.ts +2 -2
- package/src/luma-image-model-options.ts +71 -0
- package/src/luma-image-model.ts +32 -75
- package/src/luma-provider.ts +11 -7
- package/dist/index.d.mts +0 -76
- package/dist/index.mjs +0 -399
- package/dist/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,244 @@
|
|
|
1
1
|
# @ai-sdk/luma
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.31
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
|
|
8
|
+
|
|
9
|
+
For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [08d2129]
|
|
14
|
+
- @ai-sdk/provider-utils@5.0.0-beta.30
|
|
15
|
+
|
|
16
|
+
## 3.0.0-beta.30
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
|
|
21
|
+
- Updated dependencies [9bd6512]
|
|
22
|
+
- Updated dependencies [258c093]
|
|
23
|
+
- Updated dependencies [b6783da]
|
|
24
|
+
- @ai-sdk/provider-utils@5.0.0-beta.29
|
|
25
|
+
- @ai-sdk/provider@4.0.0-beta.14
|
|
26
|
+
|
|
27
|
+
## 3.0.0-beta.29
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- 9f0e36c: trigger release for all packages after provenance setup
|
|
32
|
+
- Updated dependencies [9f0e36c]
|
|
33
|
+
- @ai-sdk/provider@4.0.0-beta.13
|
|
34
|
+
- @ai-sdk/provider-utils@5.0.0-beta.28
|
|
35
|
+
|
|
36
|
+
## 3.0.0-beta.28
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [785fe16]
|
|
41
|
+
- Updated dependencies [67df0a0]
|
|
42
|
+
- Updated dependencies [befb78c]
|
|
43
|
+
- Updated dependencies [0458559]
|
|
44
|
+
- Updated dependencies [5852c0a]
|
|
45
|
+
- Updated dependencies [fc92055]
|
|
46
|
+
- @ai-sdk/provider-utils@5.0.0-beta.27
|
|
47
|
+
|
|
48
|
+
## 3.0.0-beta.27
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- Updated dependencies [2e98477]
|
|
53
|
+
- @ai-sdk/provider-utils@5.0.0-beta.26
|
|
54
|
+
|
|
55
|
+
## 3.0.0-beta.26
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- Updated dependencies [eea8d98]
|
|
60
|
+
- @ai-sdk/provider-utils@5.0.0-beta.25
|
|
61
|
+
|
|
62
|
+
## 3.0.0-beta.25
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- Updated dependencies [f807e45]
|
|
67
|
+
- @ai-sdk/provider-utils@5.0.0-beta.24
|
|
68
|
+
|
|
69
|
+
## 3.0.0-beta.24
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- Updated dependencies [350ea38]
|
|
74
|
+
- @ai-sdk/provider-utils@5.0.0-beta.23
|
|
75
|
+
|
|
76
|
+
## 3.0.0-beta.23
|
|
77
|
+
|
|
78
|
+
### Patch Changes
|
|
79
|
+
|
|
80
|
+
- Updated dependencies [083947b]
|
|
81
|
+
- @ai-sdk/provider-utils@5.0.0-beta.22
|
|
82
|
+
|
|
83
|
+
## 3.0.0-beta.22
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- Updated dependencies [add1126]
|
|
88
|
+
- @ai-sdk/provider-utils@5.0.0-beta.21
|
|
89
|
+
|
|
90
|
+
## 3.0.0-beta.21
|
|
91
|
+
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- b3976a2: Add workflow serialization support to all provider models.
|
|
95
|
+
|
|
96
|
+
**`@ai-sdk/provider-utils`:** New `serializeModel()` helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.
|
|
97
|
+
|
|
98
|
+
**All providers:** `headers` is now optional in provider config types. This is non-breaking — existing code that passes `headers` continues to work. Custom provider implementations that construct model configs manually can now omit `headers`, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.
|
|
99
|
+
|
|
100
|
+
All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
|
|
101
|
+
|
|
102
|
+
- Updated dependencies [b3976a2]
|
|
103
|
+
- Updated dependencies [ff5eba1]
|
|
104
|
+
- @ai-sdk/provider-utils@5.0.0-beta.20
|
|
105
|
+
- @ai-sdk/provider@4.0.0-beta.12
|
|
106
|
+
|
|
107
|
+
## 3.0.0-beta.20
|
|
108
|
+
|
|
109
|
+
### Major Changes
|
|
110
|
+
|
|
111
|
+
- ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- Updated dependencies [ef992f8]
|
|
116
|
+
- @ai-sdk/provider@4.0.0-beta.11
|
|
117
|
+
- @ai-sdk/provider-utils@5.0.0-beta.19
|
|
118
|
+
|
|
119
|
+
## 3.0.0-beta.19
|
|
120
|
+
|
|
121
|
+
### Patch Changes
|
|
122
|
+
|
|
123
|
+
- 90e2d8a: chore: fix unused vars not being flagged by our lint tooling
|
|
124
|
+
- Updated dependencies [90e2d8a]
|
|
125
|
+
- @ai-sdk/provider-utils@5.0.0-beta.18
|
|
126
|
+
|
|
127
|
+
## 3.0.0-beta.18
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- Updated dependencies [3ae1786]
|
|
132
|
+
- @ai-sdk/provider-utils@5.0.0-beta.17
|
|
133
|
+
|
|
134
|
+
## 3.0.0-beta.17
|
|
135
|
+
|
|
136
|
+
### Patch Changes
|
|
137
|
+
|
|
138
|
+
- Updated dependencies [176466a]
|
|
139
|
+
- @ai-sdk/provider@4.0.0-beta.10
|
|
140
|
+
- @ai-sdk/provider-utils@5.0.0-beta.16
|
|
141
|
+
|
|
142
|
+
## 3.0.0-beta.16
|
|
143
|
+
|
|
144
|
+
### Patch Changes
|
|
145
|
+
|
|
146
|
+
- Updated dependencies [e311194]
|
|
147
|
+
- @ai-sdk/provider@4.0.0-beta.9
|
|
148
|
+
- @ai-sdk/provider-utils@5.0.0-beta.15
|
|
149
|
+
|
|
150
|
+
## 3.0.0-beta.15
|
|
151
|
+
|
|
152
|
+
### Patch Changes
|
|
153
|
+
|
|
154
|
+
- Updated dependencies [34bd95d]
|
|
155
|
+
- Updated dependencies [008271d]
|
|
156
|
+
- @ai-sdk/provider@4.0.0-beta.8
|
|
157
|
+
- @ai-sdk/provider-utils@5.0.0-beta.14
|
|
158
|
+
|
|
159
|
+
## 3.0.0-beta.14
|
|
160
|
+
|
|
161
|
+
### Patch Changes
|
|
162
|
+
|
|
163
|
+
- Updated dependencies [b0c2869]
|
|
164
|
+
- Updated dependencies [7e26e81]
|
|
165
|
+
- @ai-sdk/provider-utils@5.0.0-beta.13
|
|
166
|
+
|
|
167
|
+
## 3.0.0-beta.13
|
|
168
|
+
|
|
169
|
+
### Patch Changes
|
|
170
|
+
|
|
171
|
+
- Updated dependencies [46d1149]
|
|
172
|
+
- @ai-sdk/provider-utils@5.0.0-beta.12
|
|
173
|
+
|
|
174
|
+
## 3.0.0-beta.12
|
|
175
|
+
|
|
176
|
+
### Patch Changes
|
|
177
|
+
|
|
178
|
+
- Updated dependencies [6fd51c0]
|
|
179
|
+
- @ai-sdk/provider-utils@5.0.0-beta.11
|
|
180
|
+
- @ai-sdk/provider@4.0.0-beta.7
|
|
181
|
+
|
|
182
|
+
## 3.0.0-beta.11
|
|
183
|
+
|
|
184
|
+
### Patch Changes
|
|
185
|
+
|
|
186
|
+
- Updated dependencies [c29a26f]
|
|
187
|
+
- @ai-sdk/provider-utils@5.0.0-beta.10
|
|
188
|
+
- @ai-sdk/provider@4.0.0-beta.6
|
|
189
|
+
|
|
190
|
+
## 3.0.0-beta.10
|
|
191
|
+
|
|
192
|
+
### Patch Changes
|
|
193
|
+
|
|
194
|
+
- 38fc777: Add AI Gateway hint to provider READMEs
|
|
195
|
+
|
|
196
|
+
## 3.0.0-beta.9
|
|
197
|
+
|
|
198
|
+
### Patch Changes
|
|
199
|
+
|
|
200
|
+
- Updated dependencies [2e17091]
|
|
201
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
202
|
+
|
|
203
|
+
## 3.0.0-beta.8
|
|
204
|
+
|
|
205
|
+
### Patch Changes
|
|
206
|
+
|
|
207
|
+
- Updated dependencies [986c6fd]
|
|
208
|
+
- Updated dependencies [493295c]
|
|
209
|
+
- @ai-sdk/provider-utils@5.0.0-beta.8
|
|
210
|
+
|
|
211
|
+
## 3.0.0-beta.7
|
|
212
|
+
|
|
213
|
+
### Patch Changes
|
|
214
|
+
|
|
215
|
+
- Updated dependencies [1f509d4]
|
|
216
|
+
- @ai-sdk/provider-utils@5.0.0-beta.7
|
|
217
|
+
- @ai-sdk/provider@4.0.0-beta.5
|
|
218
|
+
|
|
219
|
+
## 3.0.0-beta.6
|
|
220
|
+
|
|
221
|
+
### Patch Changes
|
|
222
|
+
|
|
223
|
+
- Updated dependencies [3887c70]
|
|
224
|
+
- @ai-sdk/provider-utils@5.0.0-beta.6
|
|
225
|
+
- @ai-sdk/provider@4.0.0-beta.4
|
|
226
|
+
|
|
227
|
+
## 3.0.0-beta.5
|
|
228
|
+
|
|
229
|
+
### Patch Changes
|
|
230
|
+
|
|
231
|
+
- Updated dependencies [776b617]
|
|
232
|
+
- @ai-sdk/provider-utils@5.0.0-beta.5
|
|
233
|
+
- @ai-sdk/provider@4.0.0-beta.3
|
|
234
|
+
|
|
235
|
+
## 3.0.0-beta.4
|
|
236
|
+
|
|
237
|
+
### Patch Changes
|
|
238
|
+
|
|
239
|
+
- Updated dependencies [61753c3]
|
|
240
|
+
- @ai-sdk/provider-utils@5.0.0-beta.4
|
|
241
|
+
|
|
3
242
|
## 3.0.0-beta.3
|
|
4
243
|
|
|
5
244
|
### Patch Changes
|
|
@@ -226,13 +465,13 @@
|
|
|
226
465
|
Before
|
|
227
466
|
|
|
228
467
|
```ts
|
|
229
|
-
model.textEmbeddingModel(
|
|
468
|
+
model.textEmbeddingModel("my-model-id");
|
|
230
469
|
```
|
|
231
470
|
|
|
232
471
|
After
|
|
233
472
|
|
|
234
473
|
```ts
|
|
235
|
-
model.embeddingModel(
|
|
474
|
+
model.embeddingModel("my-model-id");
|
|
236
475
|
```
|
|
237
476
|
|
|
238
477
|
- 95f65c2: chore: use import \* from zod/v4
|
|
@@ -434,13 +673,13 @@
|
|
|
434
673
|
Before
|
|
435
674
|
|
|
436
675
|
```ts
|
|
437
|
-
model.textEmbeddingModel(
|
|
676
|
+
model.textEmbeddingModel("my-model-id");
|
|
438
677
|
```
|
|
439
678
|
|
|
440
679
|
After
|
|
441
680
|
|
|
442
681
|
```ts
|
|
443
|
-
model.embeddingModel(
|
|
682
|
+
model.embeddingModel("my-model-id");
|
|
444
683
|
```
|
|
445
684
|
|
|
446
685
|
- Updated dependencies [8d9e8ad]
|
|
@@ -810,7 +1049,7 @@
|
|
|
810
1049
|
|
|
811
1050
|
```js
|
|
812
1051
|
await generateImage({
|
|
813
|
-
model: luma.image(
|
|
1052
|
+
model: luma.image("photon-flash-1", {
|
|
814
1053
|
maxImagesPerCall: 5,
|
|
815
1054
|
pollIntervalMillis: 500,
|
|
816
1055
|
}),
|
|
@@ -823,7 +1062,7 @@
|
|
|
823
1062
|
|
|
824
1063
|
```js
|
|
825
1064
|
await generateImage({
|
|
826
|
-
model: luma.image(
|
|
1065
|
+
model: luma.image("photon-flash-1"),
|
|
827
1066
|
prompt,
|
|
828
1067
|
n: 10,
|
|
829
1068
|
maxImagesPerCall: 5,
|
|
@@ -1059,7 +1298,7 @@
|
|
|
1059
1298
|
|
|
1060
1299
|
```js
|
|
1061
1300
|
await generateImage({
|
|
1062
|
-
model: luma.image(
|
|
1301
|
+
model: luma.image("photon-flash-1", {
|
|
1063
1302
|
maxImagesPerCall: 5,
|
|
1064
1303
|
pollIntervalMillis: 500,
|
|
1065
1304
|
}),
|
|
@@ -1072,7 +1311,7 @@
|
|
|
1072
1311
|
|
|
1073
1312
|
```js
|
|
1074
1313
|
await generateImage({
|
|
1075
|
-
model: luma.image(
|
|
1314
|
+
model: luma.image("photon-flash-1"),
|
|
1076
1315
|
prompt,
|
|
1077
1316
|
n: 10,
|
|
1078
1317
|
maxImagesPerCall: 5,
|
package/README.md
CHANGED
|
@@ -14,6 +14,8 @@ Luma Photon and Photon Flash are groundbreaking image generation models that del
|
|
|
14
14
|
|
|
15
15
|
For more detailed information about the Luma models and their capabilities, please visit [Luma AI](https://lumalabs.ai/).
|
|
16
16
|
|
|
17
|
+
> **Deploying to Vercel?** With Vercel's AI Gateway you can access Luma (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway).
|
|
18
|
+
|
|
17
19
|
## Setup
|
|
18
20
|
|
|
19
21
|
The Luma provider is available in the `@ai-sdk/luma` module. You can install it with:
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProviderV4, ImageModelV4 } from '@ai-sdk/provider';
|
|
2
2
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
3
|
import { FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
|
|
4
4
|
import { z } from 'zod/v4';
|
|
@@ -25,15 +25,15 @@ interface LumaProviderSettings {
|
|
|
25
25
|
*/
|
|
26
26
|
fetch?: FetchFunction;
|
|
27
27
|
}
|
|
28
|
-
interface LumaProvider extends
|
|
28
|
+
interface LumaProvider extends ProviderV4 {
|
|
29
29
|
/**
|
|
30
30
|
* Creates a model for image generation.
|
|
31
31
|
*/
|
|
32
|
-
image(modelId: LumaImageModelId):
|
|
32
|
+
image(modelId: LumaImageModelId): ImageModelV4;
|
|
33
33
|
/**
|
|
34
34
|
* Creates a model for image generation.
|
|
35
35
|
*/
|
|
36
|
-
imageModel(modelId: LumaImageModelId):
|
|
36
|
+
imageModel(modelId: LumaImageModelId): ImageModelV4;
|
|
37
37
|
/**
|
|
38
38
|
* @deprecated Use `embeddingModel` instead.
|
|
39
39
|
*/
|
|
@@ -54,6 +54,7 @@ declare const lumaErrorSchema: z.ZodObject<{
|
|
|
54
54
|
}, z.core.$strip>>;
|
|
55
55
|
}, z.core.$strip>;
|
|
56
56
|
type LumaErrorData = z.infer<typeof lumaErrorSchema>;
|
|
57
|
+
|
|
57
58
|
/**
|
|
58
59
|
* Provider options schema for Luma image generation.
|
|
59
60
|
*
|