@ai-sdk/openai 4.0.0-beta.7 → 4.0.0-beta.75
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 +642 -24
- package/README.md +2 -0
- package/dist/index.d.ts +240 -44
- package/dist/index.js +3348 -1685
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +390 -36
- package/dist/internal/index.js +2710 -1708
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +414 -40
- package/package.json +16 -17
- package/src/chat/convert-openai-chat-usage.ts +1 -1
- package/src/chat/convert-to-openai-chat-messages.ts +96 -68
- package/src/chat/map-openai-finish-reason.ts +1 -1
- package/src/chat/openai-chat-api.ts +6 -2
- package/src/chat/{openai-chat-options.ts → openai-chat-language-model-options.ts} +11 -1
- package/src/chat/openai-chat-language-model.ts +82 -148
- package/src/chat/openai-chat-prepare-tools.ts +3 -3
- package/src/completion/convert-openai-completion-usage.ts +1 -1
- package/src/completion/convert-to-openai-completion-prompt.ts +1 -2
- package/src/completion/map-openai-finish-reason.ts +1 -1
- package/src/completion/openai-completion-api.ts +5 -2
- package/src/completion/{openai-completion-options.ts → openai-completion-language-model-options.ts} +5 -1
- package/src/completion/openai-completion-language-model.ts +53 -17
- package/src/embedding/{openai-embedding-options.ts → openai-embedding-model-options.ts} +5 -1
- package/src/embedding/openai-embedding-model.ts +22 -5
- package/src/files/openai-files-api.ts +17 -0
- package/src/files/openai-files-options.ts +22 -0
- package/src/files/openai-files.ts +100 -0
- package/src/image/openai-image-model-options.ts +123 -0
- package/src/image/openai-image-model.ts +62 -83
- package/src/index.ts +15 -6
- package/src/internal/index.ts +7 -6
- package/src/openai-config.ts +7 -7
- package/src/openai-language-model-capabilities.ts +5 -4
- package/src/openai-provider.ts +80 -9
- package/src/openai-stream-error.ts +181 -0
- package/src/openai-tools.ts +12 -1
- package/src/realtime/index.ts +2 -0
- package/src/realtime/openai-realtime-event-mapper.ts +436 -0
- package/src/realtime/openai-realtime-model-options.ts +3 -0
- package/src/realtime/openai-realtime-model.ts +111 -0
- package/src/responses/convert-openai-responses-usage.ts +1 -1
- package/src/responses/convert-to-openai-responses-input.ts +345 -90
- package/src/responses/map-openai-responses-finish-reason.ts +1 -1
- package/src/responses/openai-responses-api.ts +186 -17
- package/src/responses/{openai-responses-options.ts → openai-responses-language-model-options.ts} +55 -1
- package/src/responses/openai-responses-language-model.ts +339 -55
- package/src/responses/openai-responses-prepare-tools.ts +129 -18
- package/src/responses/openai-responses-provider-metadata.ts +12 -2
- package/src/skills/openai-skills-api.ts +31 -0
- package/src/skills/openai-skills.ts +83 -0
- package/src/speech/{openai-speech-options.ts → openai-speech-model-options.ts} +5 -1
- package/src/speech/openai-speech-model.ts +23 -7
- package/src/tool/apply-patch.ts +33 -32
- package/src/tool/code-interpreter.ts +40 -41
- package/src/tool/custom.ts +2 -8
- package/src/tool/file-search.ts +3 -3
- package/src/tool/image-generation.ts +2 -2
- package/src/tool/local-shell.ts +2 -2
- package/src/tool/mcp.ts +3 -3
- package/src/tool/shell.ts +9 -4
- package/src/tool/tool-search.ts +98 -0
- package/src/tool/web-search-preview.ts +2 -2
- package/src/tool/web-search.ts +10 -2
- package/src/transcription/{openai-transcription-options.ts → openai-transcription-model-options.ts} +5 -1
- package/src/transcription/openai-transcription-model.ts +35 -13
- package/dist/index.d.mts +0 -1107
- package/dist/index.mjs +0 -6509
- package/dist/index.mjs.map +0 -1
- package/dist/internal/index.d.mts +0 -1137
- package/dist/internal/index.mjs +0 -6322
- package/dist/internal/index.mjs.map +0 -1
- package/src/image/openai-image-options.ts +0 -31
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,625 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 4.0.0-beta.75
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1772a63: Default OpenAI Responses reasoning summaries to detailed when reasoning effort is enabled.
|
|
8
|
+
|
|
9
|
+
## 4.0.0-beta.74
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- b8396f0: trigger initial beta release
|
|
14
|
+
- Updated dependencies [b8396f0]
|
|
15
|
+
- @ai-sdk/provider-utils@5.0.0-beta.49
|
|
16
|
+
- @ai-sdk/provider@4.0.0-beta.19
|
|
17
|
+
|
|
18
|
+
## 4.0.0-canary.73
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [aeda373]
|
|
23
|
+
- Updated dependencies [375fdd7]
|
|
24
|
+
- Updated dependencies [b4507d5]
|
|
25
|
+
- @ai-sdk/provider-utils@5.0.0-canary.48
|
|
26
|
+
|
|
27
|
+
## 4.0.0-canary.72
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [bae5e2b]
|
|
32
|
+
- @ai-sdk/provider-utils@5.0.0-canary.47
|
|
33
|
+
|
|
34
|
+
## 4.0.0-canary.71
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- ae7f932: fix(openai): throw retryable errors for OpenAI stream failures before output starts
|
|
39
|
+
|
|
40
|
+
## 4.0.0-canary.70
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- 6a5800e: feat(openai): add namespaces for tool definitions
|
|
45
|
+
|
|
46
|
+
## 4.0.0-canary.69
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- ce769dd: feat(provider): add experimental Realtime API support for voice conversations
|
|
51
|
+
|
|
52
|
+
Adds first-class support for realtime (speech-to-speech) APIs:
|
|
53
|
+
|
|
54
|
+
- `Experimental_RealtimeModelV4` spec in `@ai-sdk/provider` with normalized event types and factory
|
|
55
|
+
- OpenAI, Google, and xAI realtime provider implementations
|
|
56
|
+
- `openai.experimental_realtime()` / `google.experimental_realtime()` / `xai.experimental_realtime()` work in both server and browser
|
|
57
|
+
- `.getToken()` static method on each provider for server-side ephemeral token creation
|
|
58
|
+
- `experimental_getRealtimeToolDefinitions` helper for provider session tool definitions
|
|
59
|
+
- `experimental_useRealtime` hook in `@ai-sdk/react` returning `UIMessage[]` (aligned with `useChat`), with `onToolCall` and `addToolOutput` for client-driven tool execution
|
|
60
|
+
- `inputAudioTranscription` session config for showing transcribed user audio messages when supported by the provider
|
|
61
|
+
|
|
62
|
+
- Updated dependencies [ce769dd]
|
|
63
|
+
- @ai-sdk/provider@4.0.0-canary.18
|
|
64
|
+
- @ai-sdk/provider-utils@5.0.0-canary.46
|
|
65
|
+
|
|
66
|
+
## 4.0.0-canary.68
|
|
67
|
+
|
|
68
|
+
### Patch Changes
|
|
69
|
+
|
|
70
|
+
- 94eba1b: fix(openai): round-trip `namespace` on function_call input items
|
|
71
|
+
|
|
72
|
+
When `tool_search` dispatches a deferred tool, the resulting `function_call` carries a `namespace` field identifying which deferred-tool group the model picked. `#14789` preserved this on the read side (`providerMetadata.openai.namespace`), but the write side still serialized `function_call` input items without `namespace`. Multi-step / multi-turn conversations then failed with `Missing namespace for function_call '<name>'. ... Round-trip the model's function_call item with its namespace field included.`
|
|
73
|
+
|
|
74
|
+
`convert-to-openai-responses-input.ts` now reads `namespace` from `providerOptions.openai.namespace` (or `providerMetadata.openai.namespace`) on `tool-call` parts and includes it on the serialized `function_call` item, mirroring how `itemId` is round-tripped.
|
|
75
|
+
|
|
76
|
+
## 4.0.0-canary.67
|
|
77
|
+
|
|
78
|
+
### Patch Changes
|
|
79
|
+
|
|
80
|
+
- 61bcdb5: fix(provider/openai): send client-executed tool calls as full function_call items in the Responses API so they pair with their function_call_output by call_id
|
|
81
|
+
- Updated dependencies [ee798eb]
|
|
82
|
+
- Updated dependencies [daf6637]
|
|
83
|
+
- @ai-sdk/provider-utils@5.0.0-canary.45
|
|
84
|
+
|
|
85
|
+
## 4.0.0-canary.66
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- e776fc7: feat(provider/azure):web search tool in the Azure OpenAI Responses API.
|
|
90
|
+
|
|
91
|
+
## 4.0.0-canary.65
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- cd3de8b: feat(openai): forward `web_search_call.action.queries` from Responses API
|
|
96
|
+
|
|
97
|
+
## 4.0.0-canary.64
|
|
98
|
+
|
|
99
|
+
### Patch Changes
|
|
100
|
+
|
|
101
|
+
- Updated dependencies [6c93e36]
|
|
102
|
+
- Updated dependencies [f617ac2]
|
|
103
|
+
- @ai-sdk/provider-utils@5.0.0-canary.44
|
|
104
|
+
|
|
105
|
+
## 4.0.0-canary.63
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- 17b5597: fix(openai): skip passing reasoning items when using previous response id
|
|
110
|
+
|
|
111
|
+
## 4.0.0-canary.62
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- bf837fe: feat(provider/gateway): add speech and transcription model support
|
|
116
|
+
|
|
117
|
+
## 4.0.0-canary.61
|
|
118
|
+
|
|
119
|
+
### Patch Changes
|
|
120
|
+
|
|
121
|
+
- 7fc6bd6: Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
|
|
122
|
+
- Updated dependencies [7fc6bd6]
|
|
123
|
+
- @ai-sdk/provider-utils@5.0.0-canary.43
|
|
124
|
+
- @ai-sdk/provider@4.0.0-canary.17
|
|
125
|
+
|
|
126
|
+
## 4.0.0-canary.60
|
|
127
|
+
|
|
128
|
+
### Patch Changes
|
|
129
|
+
|
|
130
|
+
- Updated dependencies [a6617c5]
|
|
131
|
+
- @ai-sdk/provider-utils@5.0.0-canary.42
|
|
132
|
+
|
|
133
|
+
## 4.0.0-canary.59
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- 685cec7: feat(openai): add opt-in pass-through for unsupported file media types
|
|
138
|
+
|
|
139
|
+
## 4.0.0-canary.58
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- Updated dependencies [28dfa06]
|
|
144
|
+
- Updated dependencies [e93fa91]
|
|
145
|
+
- @ai-sdk/provider-utils@5.0.0-canary.41
|
|
146
|
+
|
|
147
|
+
## 4.0.0-canary.57
|
|
148
|
+
|
|
149
|
+
### Patch Changes
|
|
150
|
+
|
|
151
|
+
- Updated dependencies [a7de9c9]
|
|
152
|
+
- @ai-sdk/provider-utils@5.0.0-canary.40
|
|
153
|
+
|
|
154
|
+
## 4.0.0-canary.56
|
|
155
|
+
|
|
156
|
+
### Patch Changes
|
|
157
|
+
|
|
158
|
+
- Updated dependencies [105f95b]
|
|
159
|
+
- @ai-sdk/provider-utils@5.0.0-canary.39
|
|
160
|
+
|
|
161
|
+
## 4.0.0-canary.55
|
|
162
|
+
|
|
163
|
+
### Patch Changes
|
|
164
|
+
|
|
165
|
+
- Updated dependencies [ca446f8]
|
|
166
|
+
- @ai-sdk/provider-utils@5.0.0-canary.38
|
|
167
|
+
|
|
168
|
+
## 4.0.0-canary.54
|
|
169
|
+
|
|
170
|
+
### Patch Changes
|
|
171
|
+
|
|
172
|
+
- Updated dependencies [d848405]
|
|
173
|
+
- @ai-sdk/provider-utils@5.0.0-canary.37
|
|
174
|
+
|
|
175
|
+
## 4.0.0-canary.53
|
|
176
|
+
|
|
177
|
+
### Patch Changes
|
|
178
|
+
|
|
179
|
+
- Updated dependencies [ca39020]
|
|
180
|
+
- @ai-sdk/provider-utils@5.0.0-canary.36
|
|
181
|
+
|
|
182
|
+
## 4.0.0-canary.52
|
|
183
|
+
|
|
184
|
+
### Patch Changes
|
|
185
|
+
|
|
186
|
+
- Updated dependencies [f634bac]
|
|
187
|
+
- @ai-sdk/provider-utils@5.0.0-canary.35
|
|
188
|
+
|
|
189
|
+
## 4.0.0-canary.51
|
|
190
|
+
|
|
191
|
+
### Patch Changes
|
|
192
|
+
|
|
193
|
+
- Updated dependencies [69254e0]
|
|
194
|
+
- Updated dependencies [3015fc3]
|
|
195
|
+
- @ai-sdk/provider-utils@5.0.0-canary.34
|
|
196
|
+
|
|
197
|
+
## 4.0.0-canary.50
|
|
198
|
+
|
|
199
|
+
### Patch Changes
|
|
200
|
+
|
|
201
|
+
- 29e6ac6: feat: add allowedTools provider option for OpenAI Responses
|
|
202
|
+
|
|
203
|
+
## 4.0.0-canary.49
|
|
204
|
+
|
|
205
|
+
### Patch Changes
|
|
206
|
+
|
|
207
|
+
- 7bbc194: feat(provider/openai): forward imageDetail providerOptions on tool-result image content
|
|
208
|
+
- Updated dependencies [2427d88]
|
|
209
|
+
- @ai-sdk/provider-utils@5.0.0-canary.33
|
|
210
|
+
|
|
211
|
+
## 4.0.0-canary.48
|
|
212
|
+
|
|
213
|
+
### Patch Changes
|
|
214
|
+
|
|
215
|
+
- d6c79e3: feat(openai): add GPT-5.5 chat model IDs
|
|
216
|
+
|
|
217
|
+
## 4.0.0-canary.47
|
|
218
|
+
|
|
219
|
+
### Patch Changes
|
|
220
|
+
|
|
221
|
+
- 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types
|
|
222
|
+
- Updated dependencies [5463d0d]
|
|
223
|
+
- @ai-sdk/provider-utils@5.0.0-canary.32
|
|
224
|
+
- @ai-sdk/provider@4.0.0-canary.16
|
|
225
|
+
|
|
226
|
+
## 4.0.0-canary.46
|
|
227
|
+
|
|
228
|
+
### Patch Changes
|
|
229
|
+
|
|
230
|
+
- cd9c311: fix(openai, openai-compatible): only send null content for assistant messages with tool calls
|
|
231
|
+
|
|
232
|
+
## 4.0.0-canary.45
|
|
233
|
+
|
|
234
|
+
### Patch Changes
|
|
235
|
+
|
|
236
|
+
- 0c4c275: trigger initial canary release
|
|
237
|
+
- Updated dependencies [0c4c275]
|
|
238
|
+
- @ai-sdk/provider-utils@5.0.0-canary.31
|
|
239
|
+
- @ai-sdk/provider@4.0.0-canary.15
|
|
240
|
+
|
|
241
|
+
## 4.0.0-beta.44
|
|
242
|
+
|
|
243
|
+
### Patch Changes
|
|
244
|
+
|
|
245
|
+
- bada0f3: feat(openai): preserve `namespace` on function_call output items
|
|
246
|
+
|
|
247
|
+
## 4.0.0-beta.43
|
|
248
|
+
|
|
249
|
+
### Patch Changes
|
|
250
|
+
|
|
251
|
+
- 9ea40e0: chore(provider/openai): add type for image model options for type-safe processing
|
|
252
|
+
|
|
253
|
+
## 4.0.0-beta.42
|
|
254
|
+
|
|
255
|
+
### Major Changes
|
|
256
|
+
|
|
257
|
+
- 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
|
|
258
|
+
|
|
259
|
+
For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
|
|
260
|
+
|
|
261
|
+
### Patch Changes
|
|
262
|
+
|
|
263
|
+
- Updated dependencies [08d2129]
|
|
264
|
+
- @ai-sdk/provider-utils@5.0.0-beta.30
|
|
265
|
+
|
|
266
|
+
## 4.0.0-beta.41
|
|
267
|
+
|
|
268
|
+
### Patch Changes
|
|
269
|
+
|
|
270
|
+
- 9bd6512: feat(provider): change file part data property to be tagged with a type and remove the image part type
|
|
271
|
+
- 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
|
|
272
|
+
- Updated dependencies [9bd6512]
|
|
273
|
+
- Updated dependencies [258c093]
|
|
274
|
+
- Updated dependencies [b6783da]
|
|
275
|
+
- @ai-sdk/provider-utils@5.0.0-beta.29
|
|
276
|
+
- @ai-sdk/provider@4.0.0-beta.14
|
|
277
|
+
|
|
278
|
+
## 4.0.0-beta.40
|
|
279
|
+
|
|
280
|
+
### Patch Changes
|
|
281
|
+
|
|
282
|
+
- 9f0e36c: trigger release for all packages after provenance setup
|
|
283
|
+
- Updated dependencies [9f0e36c]
|
|
284
|
+
- @ai-sdk/provider@4.0.0-beta.13
|
|
285
|
+
- @ai-sdk/provider-utils@5.0.0-beta.28
|
|
286
|
+
|
|
287
|
+
## 4.0.0-beta.39
|
|
288
|
+
|
|
289
|
+
### Patch Changes
|
|
290
|
+
|
|
291
|
+
- 58a2ad7: fix: more precise default message for tool execution denial
|
|
292
|
+
- f9acbc0: feat(provider/openai): add gpt-image-2 model support
|
|
293
|
+
- Updated dependencies [785fe16]
|
|
294
|
+
- Updated dependencies [67df0a0]
|
|
295
|
+
- Updated dependencies [befb78c]
|
|
296
|
+
- Updated dependencies [0458559]
|
|
297
|
+
- Updated dependencies [5852c0a]
|
|
298
|
+
- Updated dependencies [fc92055]
|
|
299
|
+
- @ai-sdk/provider-utils@5.0.0-beta.27
|
|
300
|
+
|
|
301
|
+
## 4.0.0-beta.38
|
|
302
|
+
|
|
303
|
+
### Patch Changes
|
|
304
|
+
|
|
305
|
+
- bfb756d: patch - send content: null instead of empty string for tool-only assistant messages
|
|
306
|
+
- Updated dependencies [2e98477]
|
|
307
|
+
- @ai-sdk/provider-utils@5.0.0-beta.26
|
|
308
|
+
|
|
309
|
+
## 4.0.0-beta.37
|
|
310
|
+
|
|
311
|
+
### Patch Changes
|
|
312
|
+
|
|
313
|
+
- Updated dependencies [eea8d98]
|
|
314
|
+
- @ai-sdk/provider-utils@5.0.0-beta.25
|
|
315
|
+
|
|
316
|
+
## 4.0.0-beta.36
|
|
317
|
+
|
|
318
|
+
### Patch Changes
|
|
319
|
+
|
|
320
|
+
- f807e45: Extract shared `StreamingToolCallTracker` class into `@ai-sdk/provider-utils` to deduplicate streaming tool call handling across OpenAI-compatible providers. Also adds missing `generateId()` fallback for `toolCallId` in Alibaba's `doGenerate` path and ensures all providers finalize unfinished tool calls during stream flush.
|
|
321
|
+
- Updated dependencies [f807e45]
|
|
322
|
+
- @ai-sdk/provider-utils@5.0.0-beta.24
|
|
323
|
+
|
|
324
|
+
## 4.0.0-beta.35
|
|
325
|
+
|
|
326
|
+
### Patch Changes
|
|
327
|
+
|
|
328
|
+
- Updated dependencies [350ea38]
|
|
329
|
+
- @ai-sdk/provider-utils@5.0.0-beta.23
|
|
330
|
+
|
|
331
|
+
## 4.0.0-beta.34
|
|
332
|
+
|
|
333
|
+
### Patch Changes
|
|
334
|
+
|
|
335
|
+
- Updated dependencies [083947b]
|
|
336
|
+
- @ai-sdk/provider-utils@5.0.0-beta.22
|
|
337
|
+
|
|
338
|
+
## 4.0.0-beta.33
|
|
339
|
+
|
|
340
|
+
### Patch Changes
|
|
341
|
+
|
|
342
|
+
- Updated dependencies [add1126]
|
|
343
|
+
- @ai-sdk/provider-utils@5.0.0-beta.21
|
|
344
|
+
|
|
345
|
+
## 4.0.0-beta.32
|
|
346
|
+
|
|
347
|
+
### Patch Changes
|
|
348
|
+
|
|
349
|
+
- 0c4ac8a: fix(openai): default undefined tool-call input to empty object before serializing tool arguments
|
|
350
|
+
|
|
351
|
+
## 4.0.0-beta.31
|
|
352
|
+
|
|
353
|
+
### Patch Changes
|
|
354
|
+
|
|
355
|
+
- b3976a2: Add workflow serialization support to all provider models.
|
|
356
|
+
|
|
357
|
+
**`@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.
|
|
358
|
+
|
|
359
|
+
**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.
|
|
360
|
+
|
|
361
|
+
All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
|
|
362
|
+
|
|
363
|
+
- ff5eba1: feat: roll `image-*` tool output types into their equivalent `file-*` types
|
|
364
|
+
- Updated dependencies [b3976a2]
|
|
365
|
+
- Updated dependencies [ff5eba1]
|
|
366
|
+
- @ai-sdk/provider-utils@5.0.0-beta.20
|
|
367
|
+
- @ai-sdk/provider@4.0.0-beta.12
|
|
368
|
+
|
|
369
|
+
## 4.0.0-beta.30
|
|
370
|
+
|
|
371
|
+
### Major Changes
|
|
372
|
+
|
|
373
|
+
- ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
|
|
374
|
+
|
|
375
|
+
### Patch Changes
|
|
376
|
+
|
|
377
|
+
- Updated dependencies [ef992f8]
|
|
378
|
+
- @ai-sdk/provider@4.0.0-beta.11
|
|
379
|
+
- @ai-sdk/provider-utils@5.0.0-beta.19
|
|
380
|
+
|
|
381
|
+
## 4.0.0-beta.29
|
|
382
|
+
|
|
383
|
+
### Patch Changes
|
|
384
|
+
|
|
385
|
+
- 90e2d8a: chore: fix unused vars not being flagged by our lint tooling
|
|
386
|
+
- Updated dependencies [90e2d8a]
|
|
387
|
+
- @ai-sdk/provider-utils@5.0.0-beta.18
|
|
388
|
+
|
|
389
|
+
## 4.0.0-beta.28
|
|
390
|
+
|
|
391
|
+
### Patch Changes
|
|
392
|
+
|
|
393
|
+
- Updated dependencies [3ae1786]
|
|
394
|
+
- @ai-sdk/provider-utils@5.0.0-beta.17
|
|
395
|
+
|
|
396
|
+
## 4.0.0-beta.27
|
|
397
|
+
|
|
398
|
+
### Patch Changes
|
|
399
|
+
|
|
400
|
+
- Updated dependencies [176466a]
|
|
401
|
+
- @ai-sdk/provider@4.0.0-beta.10
|
|
402
|
+
- @ai-sdk/provider-utils@5.0.0-beta.16
|
|
403
|
+
|
|
404
|
+
## 4.0.0-beta.26
|
|
405
|
+
|
|
406
|
+
### Patch Changes
|
|
407
|
+
|
|
408
|
+
- e311194: feat(ai): allow passing provider instance to `uploadFile` and `uploadSkill` as shorthand
|
|
409
|
+
- Updated dependencies [e311194]
|
|
410
|
+
- @ai-sdk/provider@4.0.0-beta.9
|
|
411
|
+
- @ai-sdk/provider-utils@5.0.0-beta.15
|
|
412
|
+
|
|
413
|
+
## 4.0.0-beta.25
|
|
414
|
+
|
|
415
|
+
### Patch Changes
|
|
416
|
+
|
|
417
|
+
- 34bd95d: feat(ai): add support for uploading provider skills using the provider references abstraction
|
|
418
|
+
- Updated dependencies [34bd95d]
|
|
419
|
+
- Updated dependencies [008271d]
|
|
420
|
+
- @ai-sdk/provider@4.0.0-beta.8
|
|
421
|
+
- @ai-sdk/provider-utils@5.0.0-beta.14
|
|
422
|
+
|
|
423
|
+
## 4.0.0-beta.24
|
|
424
|
+
|
|
425
|
+
### Patch Changes
|
|
426
|
+
|
|
427
|
+
- Updated dependencies [b0c2869]
|
|
428
|
+
- Updated dependencies [7e26e81]
|
|
429
|
+
- @ai-sdk/provider-utils@5.0.0-beta.13
|
|
430
|
+
|
|
431
|
+
## 4.0.0-beta.23
|
|
432
|
+
|
|
433
|
+
### Patch Changes
|
|
434
|
+
|
|
435
|
+
- Updated dependencies [46d1149]
|
|
436
|
+
- @ai-sdk/provider-utils@5.0.0-beta.12
|
|
437
|
+
|
|
438
|
+
## 4.0.0-beta.22
|
|
439
|
+
|
|
440
|
+
### Patch Changes
|
|
441
|
+
|
|
442
|
+
- 6fd51c0: fix(provider): preserve error type prefix in getErrorMessage
|
|
443
|
+
- Updated dependencies [6fd51c0]
|
|
444
|
+
- @ai-sdk/provider-utils@5.0.0-beta.11
|
|
445
|
+
- @ai-sdk/provider@4.0.0-beta.7
|
|
446
|
+
|
|
447
|
+
## 4.0.0-beta.21
|
|
448
|
+
|
|
449
|
+
### Patch Changes
|
|
450
|
+
|
|
451
|
+
- c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
|
|
452
|
+
- Updated dependencies [c29a26f]
|
|
453
|
+
- @ai-sdk/provider-utils@5.0.0-beta.10
|
|
454
|
+
- @ai-sdk/provider@4.0.0-beta.6
|
|
455
|
+
|
|
456
|
+
## 4.0.0-beta.20
|
|
457
|
+
|
|
458
|
+
### Patch Changes
|
|
459
|
+
|
|
460
|
+
- 38fc777: Add AI Gateway hint to provider READMEs
|
|
461
|
+
|
|
462
|
+
## 4.0.0-beta.19
|
|
463
|
+
|
|
464
|
+
### Patch Changes
|
|
465
|
+
|
|
466
|
+
- Updated dependencies [2e17091]
|
|
467
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
468
|
+
|
|
469
|
+
## 4.0.0-beta.18
|
|
470
|
+
|
|
471
|
+
### Patch Changes
|
|
472
|
+
|
|
473
|
+
- Updated dependencies [986c6fd]
|
|
474
|
+
- Updated dependencies [493295c]
|
|
475
|
+
- @ai-sdk/provider-utils@5.0.0-beta.8
|
|
476
|
+
|
|
477
|
+
## 4.0.0-beta.17
|
|
478
|
+
|
|
479
|
+
### Patch Changes
|
|
480
|
+
|
|
481
|
+
- 817a1a6: fix(openai): support file-url parts in tool output content
|
|
482
|
+
|
|
483
|
+
## 4.0.0-beta.16
|
|
484
|
+
|
|
485
|
+
### Patch Changes
|
|
486
|
+
|
|
487
|
+
- 1f509d4: fix(ai): force template check on 'kind' param
|
|
488
|
+
- Updated dependencies [1f509d4]
|
|
489
|
+
- @ai-sdk/provider-utils@5.0.0-beta.7
|
|
490
|
+
- @ai-sdk/provider@4.0.0-beta.5
|
|
491
|
+
|
|
492
|
+
## 4.0.0-beta.15
|
|
493
|
+
|
|
494
|
+
### Patch Changes
|
|
495
|
+
|
|
496
|
+
- 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.
|
|
497
|
+
|
|
498
|
+
## 4.0.0-beta.14
|
|
499
|
+
|
|
500
|
+
### Patch Changes
|
|
501
|
+
|
|
502
|
+
- e6376c2: fix(openai): preserve raw finish reason for failed responses stream events
|
|
503
|
+
|
|
504
|
+
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`.
|
|
505
|
+
|
|
506
|
+
## 4.0.0-beta.13
|
|
507
|
+
|
|
508
|
+
### Patch Changes
|
|
509
|
+
|
|
510
|
+
- 3887c70: feat(provider): add new top-level reasoning parameter to spec and support it in `generateText` and `streamText`
|
|
511
|
+
- Updated dependencies [3887c70]
|
|
512
|
+
- @ai-sdk/provider-utils@5.0.0-beta.6
|
|
513
|
+
- @ai-sdk/provider@4.0.0-beta.4
|
|
514
|
+
|
|
515
|
+
## 4.0.0-beta.12
|
|
516
|
+
|
|
517
|
+
### Patch Changes
|
|
518
|
+
|
|
519
|
+
- d9a1e9a: feat(openai): add server side compaction for openai
|
|
520
|
+
|
|
521
|
+
## 4.0.0-beta.11
|
|
522
|
+
|
|
523
|
+
### Patch Changes
|
|
524
|
+
|
|
525
|
+
- Updated dependencies [776b617]
|
|
526
|
+
- @ai-sdk/provider-utils@5.0.0-beta.5
|
|
527
|
+
- @ai-sdk/provider@4.0.0-beta.3
|
|
528
|
+
|
|
529
|
+
## 4.0.0-beta.10
|
|
530
|
+
|
|
531
|
+
### Major Changes
|
|
532
|
+
|
|
533
|
+
- 61753c3: ### `@ai-sdk/openai`: remove redundant `name` argument from `openai.tools.customTool()`
|
|
534
|
+
|
|
535
|
+
`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).
|
|
536
|
+
|
|
537
|
+
migration: remove the `name` property from `customTool()` calls. the object key is now used as the tool name sent to the openai api.
|
|
538
|
+
|
|
539
|
+
before:
|
|
540
|
+
|
|
541
|
+
```ts
|
|
542
|
+
tools: {
|
|
543
|
+
write_sql: openai.tools.customTool({
|
|
544
|
+
name: 'write_sql',
|
|
545
|
+
description: '...',
|
|
546
|
+
}),
|
|
547
|
+
}
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
after:
|
|
551
|
+
|
|
552
|
+
```ts
|
|
553
|
+
tools: {
|
|
554
|
+
write_sql: openai.tools.customTool({
|
|
555
|
+
description: '...',
|
|
556
|
+
}),
|
|
557
|
+
}
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
### `@ai-sdk/provider-utils`: `createToolNameMapping()` no longer accepts the `resolveProviderToolName` parameter
|
|
561
|
+
|
|
562
|
+
before: tool name can be set dynamically
|
|
563
|
+
|
|
564
|
+
```ts
|
|
565
|
+
const toolNameMapping = createToolNameMapping({
|
|
566
|
+
tools,
|
|
567
|
+
providerToolNames: {
|
|
568
|
+
"openai.code_interpreter": "code_interpreter",
|
|
569
|
+
"openai.file_search": "file_search",
|
|
570
|
+
"openai.image_generation": "image_generation",
|
|
571
|
+
"openai.local_shell": "local_shell",
|
|
572
|
+
"openai.shell": "shell",
|
|
573
|
+
"openai.web_search": "web_search",
|
|
574
|
+
"openai.web_search_preview": "web_search_preview",
|
|
575
|
+
"openai.mcp": "mcp",
|
|
576
|
+
"openai.apply_patch": "apply_patch",
|
|
577
|
+
},
|
|
578
|
+
resolveProviderToolName: (tool) =>
|
|
579
|
+
tool.id === "openai.custom"
|
|
580
|
+
? (tool.args as { name?: string }).name
|
|
581
|
+
: undefined,
|
|
582
|
+
});
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
after: tool name is static based on `tools` keys
|
|
586
|
+
|
|
587
|
+
```
|
|
588
|
+
const toolNameMapping = createToolNameMapping({
|
|
589
|
+
tools,
|
|
590
|
+
providerToolNames: {
|
|
591
|
+
'openai.code_interpreter': 'code_interpreter',
|
|
592
|
+
'openai.file_search': 'file_search',
|
|
593
|
+
'openai.image_generation': 'image_generation',
|
|
594
|
+
'openai.local_shell': 'local_shell',
|
|
595
|
+
'openai.shell': 'shell',
|
|
596
|
+
'openai.web_search': 'web_search',
|
|
597
|
+
'openai.web_search_preview': 'web_search_preview',
|
|
598
|
+
'openai.mcp': 'mcp',
|
|
599
|
+
'openai.apply_patch': 'apply_patch',
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
### Patch Changes
|
|
605
|
+
|
|
606
|
+
- Updated dependencies [61753c3]
|
|
607
|
+
- @ai-sdk/provider-utils@5.0.0-beta.4
|
|
608
|
+
|
|
609
|
+
## 4.0.0-beta.9
|
|
610
|
+
|
|
611
|
+
### Patch Changes
|
|
612
|
+
|
|
613
|
+
- 156cdf0: feat(openai): add new tool search tool
|
|
614
|
+
|
|
615
|
+
## 4.0.0-beta.8
|
|
616
|
+
|
|
617
|
+
### Patch Changes
|
|
618
|
+
|
|
619
|
+
- Updated dependencies [f7d4f01]
|
|
620
|
+
- @ai-sdk/provider-utils@5.0.0-beta.3
|
|
621
|
+
- @ai-sdk/provider@4.0.0-beta.2
|
|
622
|
+
|
|
3
623
|
## 4.0.0-beta.7
|
|
4
624
|
|
|
5
625
|
### Patch Changes
|
|
@@ -230,7 +850,6 @@
|
|
|
230
850
|
### Patch Changes
|
|
231
851
|
|
|
232
852
|
- 04c89b1: Provide Responses API providerMetadata types at the message / reasoning level.
|
|
233
|
-
|
|
234
853
|
- Export the following types for use in client code:
|
|
235
854
|
- `OpenaiResponsesProviderMetadata`
|
|
236
855
|
- `OpenaiResponsesReasoningProviderMetadata`
|
|
@@ -311,7 +930,6 @@
|
|
|
311
930
|
### Patch Changes
|
|
312
931
|
|
|
313
932
|
- 330bd92: Fix Responses `code_interpreter` annotations and add typed providerMetadata
|
|
314
|
-
|
|
315
933
|
- Align Responses API `code_interpreter` annotation types with the official spec.
|
|
316
934
|
- Add tests to ensure the overlapping parts of the Zod schemas used by `doGenerate` and `doStream` stay in sync.
|
|
317
935
|
- Export the following types for use in client code:
|
|
@@ -396,13 +1014,13 @@
|
|
|
396
1014
|
Before
|
|
397
1015
|
|
|
398
1016
|
```ts
|
|
399
|
-
model.textEmbeddingModel(
|
|
1017
|
+
model.textEmbeddingModel("my-model-id");
|
|
400
1018
|
```
|
|
401
1019
|
|
|
402
1020
|
After
|
|
403
1021
|
|
|
404
1022
|
```ts
|
|
405
|
-
model.embeddingModel(
|
|
1023
|
+
model.embeddingModel("my-model-id");
|
|
406
1024
|
```
|
|
407
1025
|
|
|
408
1026
|
- 60f4775: fix: remove code for unsuported o1-mini and o1-preview models
|
|
@@ -412,15 +1030,15 @@
|
|
|
412
1030
|
- 2e86082: feat(provider/openai): `OpenAIChatLanguageModelOptions` type
|
|
413
1031
|
|
|
414
1032
|
```ts
|
|
415
|
-
import { openai, type OpenAIChatLanguageModelOptions } from
|
|
416
|
-
import { generateText } from
|
|
1033
|
+
import { openai, type OpenAIChatLanguageModelOptions } from "@ai-sdk/openai";
|
|
1034
|
+
import { generateText } from "ai";
|
|
417
1035
|
|
|
418
1036
|
await generateText({
|
|
419
|
-
model: openai.chat(
|
|
420
|
-
prompt:
|
|
1037
|
+
model: openai.chat("gpt-4o"),
|
|
1038
|
+
prompt: "Invent a new holiday and describe its traditions.",
|
|
421
1039
|
providerOptions: {
|
|
422
1040
|
openai: {
|
|
423
|
-
user:
|
|
1041
|
+
user: "user-123",
|
|
424
1042
|
} satisfies OpenAIChatLanguageModelOptions,
|
|
425
1043
|
},
|
|
426
1044
|
});
|
|
@@ -821,13 +1439,13 @@
|
|
|
821
1439
|
Before
|
|
822
1440
|
|
|
823
1441
|
```ts
|
|
824
|
-
model.textEmbeddingModel(
|
|
1442
|
+
model.textEmbeddingModel("my-model-id");
|
|
825
1443
|
```
|
|
826
1444
|
|
|
827
1445
|
After
|
|
828
1446
|
|
|
829
1447
|
```ts
|
|
830
|
-
model.embeddingModel(
|
|
1448
|
+
model.embeddingModel("my-model-id");
|
|
831
1449
|
```
|
|
832
1450
|
|
|
833
1451
|
- Updated dependencies [8d9e8ad]
|
|
@@ -1297,15 +1915,15 @@
|
|
|
1297
1915
|
- 2e86082: feat(provider/openai): `OpenAIChatLanguageModelOptions` type
|
|
1298
1916
|
|
|
1299
1917
|
```ts
|
|
1300
|
-
import { openai, type OpenAIChatLanguageModelOptions } from
|
|
1301
|
-
import { generateText } from
|
|
1918
|
+
import { openai, type OpenAIChatLanguageModelOptions } from "@ai-sdk/openai";
|
|
1919
|
+
import { generateText } from "ai";
|
|
1302
1920
|
|
|
1303
1921
|
await generateText({
|
|
1304
|
-
model: openai.chat(
|
|
1305
|
-
prompt:
|
|
1922
|
+
model: openai.chat("gpt-4o"),
|
|
1923
|
+
prompt: "Invent a new holiday and describe its traditions.",
|
|
1306
1924
|
providerOptions: {
|
|
1307
1925
|
openai: {
|
|
1308
|
-
user:
|
|
1926
|
+
user: "user-123",
|
|
1309
1927
|
} satisfies OpenAIChatLanguageModelOptions,
|
|
1310
1928
|
},
|
|
1311
1929
|
});
|
|
@@ -1601,7 +2219,7 @@
|
|
|
1601
2219
|
|
|
1602
2220
|
```js
|
|
1603
2221
|
await generateImage({
|
|
1604
|
-
model: luma.image(
|
|
2222
|
+
model: luma.image("photon-flash-1", {
|
|
1605
2223
|
maxImagesPerCall: 5,
|
|
1606
2224
|
pollIntervalMillis: 500,
|
|
1607
2225
|
}),
|
|
@@ -1614,7 +2232,7 @@
|
|
|
1614
2232
|
|
|
1615
2233
|
```js
|
|
1616
2234
|
await generateImage({
|
|
1617
|
-
model: luma.image(
|
|
2235
|
+
model: luma.image("photon-flash-1"),
|
|
1618
2236
|
prompt,
|
|
1619
2237
|
n: 10,
|
|
1620
2238
|
maxImagesPerCall: 5,
|
|
@@ -1676,10 +2294,10 @@
|
|
|
1676
2294
|
The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
|
|
1677
2295
|
|
|
1678
2296
|
```js
|
|
1679
|
-
const prompt =
|
|
2297
|
+
const prompt = "Santa Claus driving a Cadillac";
|
|
1680
2298
|
|
|
1681
2299
|
const { providerMetadata } = await experimental_generateImage({
|
|
1682
|
-
model: openai.image(
|
|
2300
|
+
model: openai.image("dall-e-3"),
|
|
1683
2301
|
prompt,
|
|
1684
2302
|
});
|
|
1685
2303
|
|
|
@@ -1978,7 +2596,7 @@
|
|
|
1978
2596
|
|
|
1979
2597
|
```js
|
|
1980
2598
|
await generateImage({
|
|
1981
|
-
model: luma.image(
|
|
2599
|
+
model: luma.image("photon-flash-1", {
|
|
1982
2600
|
maxImagesPerCall: 5,
|
|
1983
2601
|
pollIntervalMillis: 500,
|
|
1984
2602
|
}),
|
|
@@ -1991,7 +2609,7 @@
|
|
|
1991
2609
|
|
|
1992
2610
|
```js
|
|
1993
2611
|
await generateImage({
|
|
1994
|
-
model: luma.image(
|
|
2612
|
+
model: luma.image("photon-flash-1"),
|
|
1995
2613
|
prompt,
|
|
1996
2614
|
n: 10,
|
|
1997
2615
|
maxImagesPerCall: 5,
|
|
@@ -2036,10 +2654,10 @@
|
|
|
2036
2654
|
The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
|
|
2037
2655
|
|
|
2038
2656
|
```js
|
|
2039
|
-
const prompt =
|
|
2657
|
+
const prompt = "Santa Claus driving a Cadillac";
|
|
2040
2658
|
|
|
2041
2659
|
const { providerMetadata } = await experimental_generateImage({
|
|
2042
|
-
model: openai.image(
|
|
2660
|
+
model: openai.image("dall-e-3"),
|
|
2043
2661
|
prompt,
|
|
2044
2662
|
});
|
|
2045
2663
|
|