@ai-sdk/openai 4.0.0-beta.3 → 4.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 +320 -22
- package/README.md +2 -0
- package/dist/index.d.ts +139 -36
- package/dist/index.js +2343 -1490
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +168 -45
- package/dist/internal/index.js +2112 -1511
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +274 -9
- package/package.json +9 -12
- package/src/chat/convert-openai-chat-usage.ts +2 -2
- package/src/chat/convert-to-openai-chat-messages.ts +26 -15
- package/src/chat/map-openai-finish-reason.ts +2 -2
- package/src/chat/openai-chat-language-model.ts +52 -28
- package/src/chat/openai-chat-options.ts +5 -0
- package/src/chat/openai-chat-prepare-tools.ts +6 -6
- package/src/completion/convert-openai-completion-usage.ts +2 -2
- package/src/completion/convert-to-openai-completion-prompt.ts +2 -2
- package/src/completion/map-openai-finish-reason.ts +2 -2
- package/src/completion/openai-completion-language-model.ts +40 -23
- package/src/embedding/openai-embedding-model.ts +23 -6
- package/src/files/openai-files-api.ts +17 -0
- package/src/files/openai-files-options.ts +18 -0
- package/src/files/openai-files.ts +102 -0
- package/src/image/openai-image-model.ts +28 -11
- package/src/index.ts +2 -0
- package/src/openai-config.ts +6 -6
- package/src/openai-language-model-capabilities.ts +3 -2
- package/src/openai-provider.ts +54 -21
- package/src/openai-tools.ts +12 -1
- package/src/responses/convert-openai-responses-usage.ts +2 -2
- package/src/responses/convert-to-openai-responses-input.ts +211 -37
- package/src/responses/map-openai-responses-finish-reason.ts +2 -2
- package/src/responses/openai-responses-api.ts +136 -2
- package/src/responses/openai-responses-language-model.ts +252 -39
- package/src/responses/openai-responses-options.ts +24 -2
- package/src/responses/openai-responses-prepare-tools.ts +47 -14
- package/src/responses/openai-responses-provider-metadata.ts +10 -0
- package/src/skills/openai-skills-api.ts +31 -0
- package/src/skills/openai-skills.ts +87 -0
- package/src/speech/openai-speech-model.ts +25 -8
- package/src/tool/custom.ts +0 -6
- package/src/tool/shell.ts +7 -2
- package/src/tool/tool-search.ts +98 -0
- package/src/transcription/openai-transcription-model.ts +26 -9
- package/dist/index.d.mts +0 -1107
- package/dist/index.mjs +0 -6497
- package/dist/index.mjs.map +0 -1
- package/dist/internal/index.d.mts +0 -1137
- package/dist/internal/index.mjs +0 -6310
- package/dist/internal/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,303 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 4.0.0-beta.31
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b3976a2: Add workflow serialization support to all provider models.
|
|
8
|
+
|
|
9
|
+
**`@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.
|
|
10
|
+
|
|
11
|
+
**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.
|
|
12
|
+
|
|
13
|
+
All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
|
|
14
|
+
|
|
15
|
+
- ff5eba1: feat: roll `image-*` tool output types into their equivalent `file-*` types
|
|
16
|
+
- Updated dependencies [b3976a2]
|
|
17
|
+
- Updated dependencies [ff5eba1]
|
|
18
|
+
- @ai-sdk/provider-utils@5.0.0-beta.20
|
|
19
|
+
- @ai-sdk/provider@4.0.0-beta.12
|
|
20
|
+
|
|
21
|
+
## 4.0.0-beta.30
|
|
22
|
+
|
|
23
|
+
### Major Changes
|
|
24
|
+
|
|
25
|
+
- ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [ef992f8]
|
|
30
|
+
- @ai-sdk/provider@4.0.0-beta.11
|
|
31
|
+
- @ai-sdk/provider-utils@5.0.0-beta.19
|
|
32
|
+
|
|
33
|
+
## 4.0.0-beta.29
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- 90e2d8a: chore: fix unused vars not being flagged by our lint tooling
|
|
38
|
+
- Updated dependencies [90e2d8a]
|
|
39
|
+
- @ai-sdk/provider-utils@5.0.0-beta.18
|
|
40
|
+
|
|
41
|
+
## 4.0.0-beta.28
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- Updated dependencies [3ae1786]
|
|
46
|
+
- @ai-sdk/provider-utils@5.0.0-beta.17
|
|
47
|
+
|
|
48
|
+
## 4.0.0-beta.27
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- Updated dependencies [176466a]
|
|
53
|
+
- @ai-sdk/provider@4.0.0-beta.10
|
|
54
|
+
- @ai-sdk/provider-utils@5.0.0-beta.16
|
|
55
|
+
|
|
56
|
+
## 4.0.0-beta.26
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- e311194: feat(ai): allow passing provider instance to `uploadFile` and `uploadSkill` as shorthand
|
|
61
|
+
- Updated dependencies [e311194]
|
|
62
|
+
- @ai-sdk/provider@4.0.0-beta.9
|
|
63
|
+
- @ai-sdk/provider-utils@5.0.0-beta.15
|
|
64
|
+
|
|
65
|
+
## 4.0.0-beta.25
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- 34bd95d: feat(ai): add support for uploading provider skills using the provider references abstraction
|
|
70
|
+
- Updated dependencies [34bd95d]
|
|
71
|
+
- Updated dependencies [008271d]
|
|
72
|
+
- @ai-sdk/provider@4.0.0-beta.8
|
|
73
|
+
- @ai-sdk/provider-utils@5.0.0-beta.14
|
|
74
|
+
|
|
75
|
+
## 4.0.0-beta.24
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- Updated dependencies [b0c2869]
|
|
80
|
+
- Updated dependencies [7e26e81]
|
|
81
|
+
- @ai-sdk/provider-utils@5.0.0-beta.13
|
|
82
|
+
|
|
83
|
+
## 4.0.0-beta.23
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- Updated dependencies [46d1149]
|
|
88
|
+
- @ai-sdk/provider-utils@5.0.0-beta.12
|
|
89
|
+
|
|
90
|
+
## 4.0.0-beta.22
|
|
91
|
+
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- 6fd51c0: fix(provider): preserve error type prefix in getErrorMessage
|
|
95
|
+
- Updated dependencies [6fd51c0]
|
|
96
|
+
- @ai-sdk/provider-utils@5.0.0-beta.11
|
|
97
|
+
- @ai-sdk/provider@4.0.0-beta.7
|
|
98
|
+
|
|
99
|
+
## 4.0.0-beta.21
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
|
|
104
|
+
- Updated dependencies [c29a26f]
|
|
105
|
+
- @ai-sdk/provider-utils@5.0.0-beta.10
|
|
106
|
+
- @ai-sdk/provider@4.0.0-beta.6
|
|
107
|
+
|
|
108
|
+
## 4.0.0-beta.20
|
|
109
|
+
|
|
110
|
+
### Patch Changes
|
|
111
|
+
|
|
112
|
+
- 38fc777: Add AI Gateway hint to provider READMEs
|
|
113
|
+
|
|
114
|
+
## 4.0.0-beta.19
|
|
115
|
+
|
|
116
|
+
### Patch Changes
|
|
117
|
+
|
|
118
|
+
- Updated dependencies [2e17091]
|
|
119
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
120
|
+
|
|
121
|
+
## 4.0.0-beta.18
|
|
122
|
+
|
|
123
|
+
### Patch Changes
|
|
124
|
+
|
|
125
|
+
- Updated dependencies [986c6fd]
|
|
126
|
+
- Updated dependencies [493295c]
|
|
127
|
+
- @ai-sdk/provider-utils@5.0.0-beta.8
|
|
128
|
+
|
|
129
|
+
## 4.0.0-beta.17
|
|
130
|
+
|
|
131
|
+
### Patch Changes
|
|
132
|
+
|
|
133
|
+
- 817a1a6: fix(openai): support file-url parts in tool output content
|
|
134
|
+
|
|
135
|
+
## 4.0.0-beta.16
|
|
136
|
+
|
|
137
|
+
### Patch Changes
|
|
138
|
+
|
|
139
|
+
- 1f509d4: fix(ai): force template check on 'kind' param
|
|
140
|
+
- Updated dependencies [1f509d4]
|
|
141
|
+
- @ai-sdk/provider-utils@5.0.0-beta.7
|
|
142
|
+
- @ai-sdk/provider@4.0.0-beta.5
|
|
143
|
+
|
|
144
|
+
## 4.0.0-beta.15
|
|
145
|
+
|
|
146
|
+
### Patch Changes
|
|
147
|
+
|
|
148
|
+
- 365da1a: Add `gpt-5.4-mini`, `gpt-5.4-mini-2026-03-17`, `gpt-5.4-nano`, and `gpt-5.4-nano-2026-03-17` models.
|
|
149
|
+
|
|
150
|
+
## 4.0.0-beta.14
|
|
151
|
+
|
|
152
|
+
### Patch Changes
|
|
153
|
+
|
|
154
|
+
- e6376c2: fix(openai): preserve raw finish reason for failed responses stream events
|
|
155
|
+
|
|
156
|
+
Handle `response.failed` chunks in Responses API streaming so `finishReason.raw` is preserved from `incomplete_details.reason` (e.g. `max_output_tokens`), and map failed-without-reason cases to unified `error` instead of `other`.
|
|
157
|
+
|
|
158
|
+
## 4.0.0-beta.13
|
|
159
|
+
|
|
160
|
+
### Patch Changes
|
|
161
|
+
|
|
162
|
+
- 3887c70: feat(provider): add new top-level reasoning parameter to spec and support it in `generateText` and `streamText`
|
|
163
|
+
- Updated dependencies [3887c70]
|
|
164
|
+
- @ai-sdk/provider-utils@5.0.0-beta.6
|
|
165
|
+
- @ai-sdk/provider@4.0.0-beta.4
|
|
166
|
+
|
|
167
|
+
## 4.0.0-beta.12
|
|
168
|
+
|
|
169
|
+
### Patch Changes
|
|
170
|
+
|
|
171
|
+
- d9a1e9a: feat(openai): add server side compaction for openai
|
|
172
|
+
|
|
173
|
+
## 4.0.0-beta.11
|
|
174
|
+
|
|
175
|
+
### Patch Changes
|
|
176
|
+
|
|
177
|
+
- Updated dependencies [776b617]
|
|
178
|
+
- @ai-sdk/provider-utils@5.0.0-beta.5
|
|
179
|
+
- @ai-sdk/provider@4.0.0-beta.3
|
|
180
|
+
|
|
181
|
+
## 4.0.0-beta.10
|
|
182
|
+
|
|
183
|
+
### Major Changes
|
|
184
|
+
|
|
185
|
+
- 61753c3: ### `@ai-sdk/openai`: remove redundant `name` argument from `openai.tools.customTool()`
|
|
186
|
+
|
|
187
|
+
`openai.tools.customTool()` no longer accepts a `name` field. the tool name is now derived from the sdk tool key (the object key in the `tools` object).
|
|
188
|
+
|
|
189
|
+
migration: remove the `name` property from `customTool()` calls. the object key is now used as the tool name sent to the openai api.
|
|
190
|
+
|
|
191
|
+
before:
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
tools: {
|
|
195
|
+
write_sql: openai.tools.customTool({
|
|
196
|
+
name: 'write_sql',
|
|
197
|
+
description: '...',
|
|
198
|
+
}),
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
after:
|
|
203
|
+
|
|
204
|
+
```ts
|
|
205
|
+
tools: {
|
|
206
|
+
write_sql: openai.tools.customTool({
|
|
207
|
+
description: '...',
|
|
208
|
+
}),
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### `@ai-sdk/provider-utils`: `createToolNameMapping()` no longer accepts the `resolveProviderToolName` parameter
|
|
213
|
+
|
|
214
|
+
before: tool name can be set dynamically
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
const toolNameMapping = createToolNameMapping({
|
|
218
|
+
tools,
|
|
219
|
+
providerToolNames: {
|
|
220
|
+
"openai.code_interpreter": "code_interpreter",
|
|
221
|
+
"openai.file_search": "file_search",
|
|
222
|
+
"openai.image_generation": "image_generation",
|
|
223
|
+
"openai.local_shell": "local_shell",
|
|
224
|
+
"openai.shell": "shell",
|
|
225
|
+
"openai.web_search": "web_search",
|
|
226
|
+
"openai.web_search_preview": "web_search_preview",
|
|
227
|
+
"openai.mcp": "mcp",
|
|
228
|
+
"openai.apply_patch": "apply_patch",
|
|
229
|
+
},
|
|
230
|
+
resolveProviderToolName: (tool) =>
|
|
231
|
+
tool.id === "openai.custom"
|
|
232
|
+
? (tool.args as { name?: string }).name
|
|
233
|
+
: undefined,
|
|
234
|
+
});
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
after: tool name is static based on `tools` keys
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
const toolNameMapping = createToolNameMapping({
|
|
241
|
+
tools,
|
|
242
|
+
providerToolNames: {
|
|
243
|
+
'openai.code_interpreter': 'code_interpreter',
|
|
244
|
+
'openai.file_search': 'file_search',
|
|
245
|
+
'openai.image_generation': 'image_generation',
|
|
246
|
+
'openai.local_shell': 'local_shell',
|
|
247
|
+
'openai.shell': 'shell',
|
|
248
|
+
'openai.web_search': 'web_search',
|
|
249
|
+
'openai.web_search_preview': 'web_search_preview',
|
|
250
|
+
'openai.mcp': 'mcp',
|
|
251
|
+
'openai.apply_patch': 'apply_patch',
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### Patch Changes
|
|
257
|
+
|
|
258
|
+
- Updated dependencies [61753c3]
|
|
259
|
+
- @ai-sdk/provider-utils@5.0.0-beta.4
|
|
260
|
+
|
|
261
|
+
## 4.0.0-beta.9
|
|
262
|
+
|
|
263
|
+
### Patch Changes
|
|
264
|
+
|
|
265
|
+
- 156cdf0: feat(openai): add new tool search tool
|
|
266
|
+
|
|
267
|
+
## 4.0.0-beta.8
|
|
268
|
+
|
|
269
|
+
### Patch Changes
|
|
270
|
+
|
|
271
|
+
- Updated dependencies [f7d4f01]
|
|
272
|
+
- @ai-sdk/provider-utils@5.0.0-beta.3
|
|
273
|
+
- @ai-sdk/provider@4.0.0-beta.2
|
|
274
|
+
|
|
275
|
+
## 4.0.0-beta.7
|
|
276
|
+
|
|
277
|
+
### Patch Changes
|
|
278
|
+
|
|
279
|
+
- Updated dependencies [5c2a5a2]
|
|
280
|
+
- @ai-sdk/provider@4.0.0-beta.1
|
|
281
|
+
- @ai-sdk/provider-utils@5.0.0-beta.2
|
|
282
|
+
|
|
283
|
+
## 4.0.0-beta.6
|
|
284
|
+
|
|
285
|
+
### Patch Changes
|
|
286
|
+
|
|
287
|
+
- 83f9d04: feat(openai): upgrade v3 specs to v4
|
|
288
|
+
|
|
289
|
+
## 4.0.0-beta.5
|
|
290
|
+
|
|
291
|
+
### Patch Changes
|
|
292
|
+
|
|
293
|
+
- ac18f89: feat(provider/openai): add `gpt-5.3-chat-latest`
|
|
294
|
+
|
|
295
|
+
## 4.0.0-beta.4
|
|
296
|
+
|
|
297
|
+
### Patch Changes
|
|
298
|
+
|
|
299
|
+
- a71d345: fix(provider/openai): drop reasoning parts without encrypted content when store: false
|
|
300
|
+
|
|
3
301
|
## 4.0.0-beta.3
|
|
4
302
|
|
|
5
303
|
### Patch Changes
|
|
@@ -370,13 +668,13 @@
|
|
|
370
668
|
Before
|
|
371
669
|
|
|
372
670
|
```ts
|
|
373
|
-
model.textEmbeddingModel(
|
|
671
|
+
model.textEmbeddingModel("my-model-id");
|
|
374
672
|
```
|
|
375
673
|
|
|
376
674
|
After
|
|
377
675
|
|
|
378
676
|
```ts
|
|
379
|
-
model.embeddingModel(
|
|
677
|
+
model.embeddingModel("my-model-id");
|
|
380
678
|
```
|
|
381
679
|
|
|
382
680
|
- 60f4775: fix: remove code for unsuported o1-mini and o1-preview models
|
|
@@ -386,15 +684,15 @@
|
|
|
386
684
|
- 2e86082: feat(provider/openai): `OpenAIChatLanguageModelOptions` type
|
|
387
685
|
|
|
388
686
|
```ts
|
|
389
|
-
import { openai, type OpenAIChatLanguageModelOptions } from
|
|
390
|
-
import { generateText } from
|
|
687
|
+
import { openai, type OpenAIChatLanguageModelOptions } from "@ai-sdk/openai";
|
|
688
|
+
import { generateText } from "ai";
|
|
391
689
|
|
|
392
690
|
await generateText({
|
|
393
|
-
model: openai.chat(
|
|
394
|
-
prompt:
|
|
691
|
+
model: openai.chat("gpt-4o"),
|
|
692
|
+
prompt: "Invent a new holiday and describe its traditions.",
|
|
395
693
|
providerOptions: {
|
|
396
694
|
openai: {
|
|
397
|
-
user:
|
|
695
|
+
user: "user-123",
|
|
398
696
|
} satisfies OpenAIChatLanguageModelOptions,
|
|
399
697
|
},
|
|
400
698
|
});
|
|
@@ -795,13 +1093,13 @@
|
|
|
795
1093
|
Before
|
|
796
1094
|
|
|
797
1095
|
```ts
|
|
798
|
-
model.textEmbeddingModel(
|
|
1096
|
+
model.textEmbeddingModel("my-model-id");
|
|
799
1097
|
```
|
|
800
1098
|
|
|
801
1099
|
After
|
|
802
1100
|
|
|
803
1101
|
```ts
|
|
804
|
-
model.embeddingModel(
|
|
1102
|
+
model.embeddingModel("my-model-id");
|
|
805
1103
|
```
|
|
806
1104
|
|
|
807
1105
|
- Updated dependencies [8d9e8ad]
|
|
@@ -1271,15 +1569,15 @@
|
|
|
1271
1569
|
- 2e86082: feat(provider/openai): `OpenAIChatLanguageModelOptions` type
|
|
1272
1570
|
|
|
1273
1571
|
```ts
|
|
1274
|
-
import { openai, type OpenAIChatLanguageModelOptions } from
|
|
1275
|
-
import { generateText } from
|
|
1572
|
+
import { openai, type OpenAIChatLanguageModelOptions } from "@ai-sdk/openai";
|
|
1573
|
+
import { generateText } from "ai";
|
|
1276
1574
|
|
|
1277
1575
|
await generateText({
|
|
1278
|
-
model: openai.chat(
|
|
1279
|
-
prompt:
|
|
1576
|
+
model: openai.chat("gpt-4o"),
|
|
1577
|
+
prompt: "Invent a new holiday and describe its traditions.",
|
|
1280
1578
|
providerOptions: {
|
|
1281
1579
|
openai: {
|
|
1282
|
-
user:
|
|
1580
|
+
user: "user-123",
|
|
1283
1581
|
} satisfies OpenAIChatLanguageModelOptions,
|
|
1284
1582
|
},
|
|
1285
1583
|
});
|
|
@@ -1575,7 +1873,7 @@
|
|
|
1575
1873
|
|
|
1576
1874
|
```js
|
|
1577
1875
|
await generateImage({
|
|
1578
|
-
model: luma.image(
|
|
1876
|
+
model: luma.image("photon-flash-1", {
|
|
1579
1877
|
maxImagesPerCall: 5,
|
|
1580
1878
|
pollIntervalMillis: 500,
|
|
1581
1879
|
}),
|
|
@@ -1588,7 +1886,7 @@
|
|
|
1588
1886
|
|
|
1589
1887
|
```js
|
|
1590
1888
|
await generateImage({
|
|
1591
|
-
model: luma.image(
|
|
1889
|
+
model: luma.image("photon-flash-1"),
|
|
1592
1890
|
prompt,
|
|
1593
1891
|
n: 10,
|
|
1594
1892
|
maxImagesPerCall: 5,
|
|
@@ -1650,10 +1948,10 @@
|
|
|
1650
1948
|
The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
|
|
1651
1949
|
|
|
1652
1950
|
```js
|
|
1653
|
-
const prompt =
|
|
1951
|
+
const prompt = "Santa Claus driving a Cadillac";
|
|
1654
1952
|
|
|
1655
1953
|
const { providerMetadata } = await experimental_generateImage({
|
|
1656
|
-
model: openai.image(
|
|
1954
|
+
model: openai.image("dall-e-3"),
|
|
1657
1955
|
prompt,
|
|
1658
1956
|
});
|
|
1659
1957
|
|
|
@@ -1952,7 +2250,7 @@
|
|
|
1952
2250
|
|
|
1953
2251
|
```js
|
|
1954
2252
|
await generateImage({
|
|
1955
|
-
model: luma.image(
|
|
2253
|
+
model: luma.image("photon-flash-1", {
|
|
1956
2254
|
maxImagesPerCall: 5,
|
|
1957
2255
|
pollIntervalMillis: 500,
|
|
1958
2256
|
}),
|
|
@@ -1965,7 +2263,7 @@
|
|
|
1965
2263
|
|
|
1966
2264
|
```js
|
|
1967
2265
|
await generateImage({
|
|
1968
|
-
model: luma.image(
|
|
2266
|
+
model: luma.image("photon-flash-1"),
|
|
1969
2267
|
prompt,
|
|
1970
2268
|
n: 10,
|
|
1971
2269
|
maxImagesPerCall: 5,
|
|
@@ -2010,10 +2308,10 @@
|
|
|
2010
2308
|
The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
|
|
2011
2309
|
|
|
2012
2310
|
```js
|
|
2013
|
-
const prompt =
|
|
2311
|
+
const prompt = "Santa Claus driving a Cadillac";
|
|
2014
2312
|
|
|
2015
2313
|
const { providerMetadata } = await experimental_generateImage({
|
|
2016
|
-
model: openai.image(
|
|
2314
|
+
model: openai.image("dall-e-3"),
|
|
2017
2315
|
prompt,
|
|
2018
2316
|
});
|
|
2019
2317
|
|
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
The **[OpenAI provider](https://ai-sdk.dev/providers/ai-sdk-providers/openai)** for the [AI SDK](https://ai-sdk.dev/docs)
|
|
4
4
|
contains language model support for the OpenAI chat and completion APIs and embedding model support for the OpenAI embeddings API.
|
|
5
5
|
|
|
6
|
+
> **Deploying to Vercel?** With Vercel's AI Gateway you can access OpenAI (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).
|
|
7
|
+
|
|
6
8
|
## Setup
|
|
7
9
|
|
|
8
10
|
The OpenAI provider is available in the `@ai-sdk/openai` module. You can install it with
|