@ai-sdk/openai 4.0.0-beta.6 → 4.0.0-beta.74
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 +644 -24
- package/README.md +2 -0
- package/dist/index.d.ts +240 -44
- package/dist/index.js +3345 -1683
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +390 -36
- package/dist/internal/index.js +2707 -1706
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +413 -39
- package/package.json +17 -18
- 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 +330 -52
- 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,627 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 4.0.0-beta.74
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b8396f0: trigger initial beta release
|
|
8
|
+
- Updated dependencies [b8396f0]
|
|
9
|
+
- @ai-sdk/provider-utils@5.0.0-beta.49
|
|
10
|
+
- @ai-sdk/provider@4.0.0-beta.19
|
|
11
|
+
|
|
12
|
+
## 4.0.0-canary.73
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [aeda373]
|
|
17
|
+
- Updated dependencies [375fdd7]
|
|
18
|
+
- Updated dependencies [b4507d5]
|
|
19
|
+
- @ai-sdk/provider-utils@5.0.0-canary.48
|
|
20
|
+
|
|
21
|
+
## 4.0.0-canary.72
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [bae5e2b]
|
|
26
|
+
- @ai-sdk/provider-utils@5.0.0-canary.47
|
|
27
|
+
|
|
28
|
+
## 4.0.0-canary.71
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- ae7f932: fix(openai): throw retryable errors for OpenAI stream failures before output starts
|
|
33
|
+
|
|
34
|
+
## 4.0.0-canary.70
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- 6a5800e: feat(openai): add namespaces for tool definitions
|
|
39
|
+
|
|
40
|
+
## 4.0.0-canary.69
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- ce769dd: feat(provider): add experimental Realtime API support for voice conversations
|
|
45
|
+
|
|
46
|
+
Adds first-class support for realtime (speech-to-speech) APIs:
|
|
47
|
+
|
|
48
|
+
- `Experimental_RealtimeModelV4` spec in `@ai-sdk/provider` with normalized event types and factory
|
|
49
|
+
- OpenAI, Google, and xAI realtime provider implementations
|
|
50
|
+
- `openai.experimental_realtime()` / `google.experimental_realtime()` / `xai.experimental_realtime()` work in both server and browser
|
|
51
|
+
- `.getToken()` static method on each provider for server-side ephemeral token creation
|
|
52
|
+
- `experimental_getRealtimeToolDefinitions` helper for provider session tool definitions
|
|
53
|
+
- `experimental_useRealtime` hook in `@ai-sdk/react` returning `UIMessage[]` (aligned with `useChat`), with `onToolCall` and `addToolOutput` for client-driven tool execution
|
|
54
|
+
- `inputAudioTranscription` session config for showing transcribed user audio messages when supported by the provider
|
|
55
|
+
|
|
56
|
+
- Updated dependencies [ce769dd]
|
|
57
|
+
- @ai-sdk/provider@4.0.0-canary.18
|
|
58
|
+
- @ai-sdk/provider-utils@5.0.0-canary.46
|
|
59
|
+
|
|
60
|
+
## 4.0.0-canary.68
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- 94eba1b: fix(openai): round-trip `namespace` on function_call input items
|
|
65
|
+
|
|
66
|
+
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.`
|
|
67
|
+
|
|
68
|
+
`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.
|
|
69
|
+
|
|
70
|
+
## 4.0.0-canary.67
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- 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
|
|
75
|
+
- Updated dependencies [ee798eb]
|
|
76
|
+
- Updated dependencies [daf6637]
|
|
77
|
+
- @ai-sdk/provider-utils@5.0.0-canary.45
|
|
78
|
+
|
|
79
|
+
## 4.0.0-canary.66
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- e776fc7: feat(provider/azure):web search tool in the Azure OpenAI Responses API.
|
|
84
|
+
|
|
85
|
+
## 4.0.0-canary.65
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- cd3de8b: feat(openai): forward `web_search_call.action.queries` from Responses API
|
|
90
|
+
|
|
91
|
+
## 4.0.0-canary.64
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- Updated dependencies [6c93e36]
|
|
96
|
+
- Updated dependencies [f617ac2]
|
|
97
|
+
- @ai-sdk/provider-utils@5.0.0-canary.44
|
|
98
|
+
|
|
99
|
+
## 4.0.0-canary.63
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- 17b5597: fix(openai): skip passing reasoning items when using previous response id
|
|
104
|
+
|
|
105
|
+
## 4.0.0-canary.62
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- bf837fe: feat(provider/gateway): add speech and transcription model support
|
|
110
|
+
|
|
111
|
+
## 4.0.0-canary.61
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- 7fc6bd6: Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
|
|
116
|
+
- Updated dependencies [7fc6bd6]
|
|
117
|
+
- @ai-sdk/provider-utils@5.0.0-canary.43
|
|
118
|
+
- @ai-sdk/provider@4.0.0-canary.17
|
|
119
|
+
|
|
120
|
+
## 4.0.0-canary.60
|
|
121
|
+
|
|
122
|
+
### Patch Changes
|
|
123
|
+
|
|
124
|
+
- Updated dependencies [a6617c5]
|
|
125
|
+
- @ai-sdk/provider-utils@5.0.0-canary.42
|
|
126
|
+
|
|
127
|
+
## 4.0.0-canary.59
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- 685cec7: feat(openai): add opt-in pass-through for unsupported file media types
|
|
132
|
+
|
|
133
|
+
## 4.0.0-canary.58
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- Updated dependencies [28dfa06]
|
|
138
|
+
- Updated dependencies [e93fa91]
|
|
139
|
+
- @ai-sdk/provider-utils@5.0.0-canary.41
|
|
140
|
+
|
|
141
|
+
## 4.0.0-canary.57
|
|
142
|
+
|
|
143
|
+
### Patch Changes
|
|
144
|
+
|
|
145
|
+
- Updated dependencies [a7de9c9]
|
|
146
|
+
- @ai-sdk/provider-utils@5.0.0-canary.40
|
|
147
|
+
|
|
148
|
+
## 4.0.0-canary.56
|
|
149
|
+
|
|
150
|
+
### Patch Changes
|
|
151
|
+
|
|
152
|
+
- Updated dependencies [105f95b]
|
|
153
|
+
- @ai-sdk/provider-utils@5.0.0-canary.39
|
|
154
|
+
|
|
155
|
+
## 4.0.0-canary.55
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- Updated dependencies [ca446f8]
|
|
160
|
+
- @ai-sdk/provider-utils@5.0.0-canary.38
|
|
161
|
+
|
|
162
|
+
## 4.0.0-canary.54
|
|
163
|
+
|
|
164
|
+
### Patch Changes
|
|
165
|
+
|
|
166
|
+
- Updated dependencies [d848405]
|
|
167
|
+
- @ai-sdk/provider-utils@5.0.0-canary.37
|
|
168
|
+
|
|
169
|
+
## 4.0.0-canary.53
|
|
170
|
+
|
|
171
|
+
### Patch Changes
|
|
172
|
+
|
|
173
|
+
- Updated dependencies [ca39020]
|
|
174
|
+
- @ai-sdk/provider-utils@5.0.0-canary.36
|
|
175
|
+
|
|
176
|
+
## 4.0.0-canary.52
|
|
177
|
+
|
|
178
|
+
### Patch Changes
|
|
179
|
+
|
|
180
|
+
- Updated dependencies [f634bac]
|
|
181
|
+
- @ai-sdk/provider-utils@5.0.0-canary.35
|
|
182
|
+
|
|
183
|
+
## 4.0.0-canary.51
|
|
184
|
+
|
|
185
|
+
### Patch Changes
|
|
186
|
+
|
|
187
|
+
- Updated dependencies [69254e0]
|
|
188
|
+
- Updated dependencies [3015fc3]
|
|
189
|
+
- @ai-sdk/provider-utils@5.0.0-canary.34
|
|
190
|
+
|
|
191
|
+
## 4.0.0-canary.50
|
|
192
|
+
|
|
193
|
+
### Patch Changes
|
|
194
|
+
|
|
195
|
+
- 29e6ac6: feat: add allowedTools provider option for OpenAI Responses
|
|
196
|
+
|
|
197
|
+
## 4.0.0-canary.49
|
|
198
|
+
|
|
199
|
+
### Patch Changes
|
|
200
|
+
|
|
201
|
+
- 7bbc194: feat(provider/openai): forward imageDetail providerOptions on tool-result image content
|
|
202
|
+
- Updated dependencies [2427d88]
|
|
203
|
+
- @ai-sdk/provider-utils@5.0.0-canary.33
|
|
204
|
+
|
|
205
|
+
## 4.0.0-canary.48
|
|
206
|
+
|
|
207
|
+
### Patch Changes
|
|
208
|
+
|
|
209
|
+
- d6c79e3: feat(openai): add GPT-5.5 chat model IDs
|
|
210
|
+
|
|
211
|
+
## 4.0.0-canary.47
|
|
212
|
+
|
|
213
|
+
### Patch Changes
|
|
214
|
+
|
|
215
|
+
- 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types
|
|
216
|
+
- Updated dependencies [5463d0d]
|
|
217
|
+
- @ai-sdk/provider-utils@5.0.0-canary.32
|
|
218
|
+
- @ai-sdk/provider@4.0.0-canary.16
|
|
219
|
+
|
|
220
|
+
## 4.0.0-canary.46
|
|
221
|
+
|
|
222
|
+
### Patch Changes
|
|
223
|
+
|
|
224
|
+
- cd9c311: fix(openai, openai-compatible): only send null content for assistant messages with tool calls
|
|
225
|
+
|
|
226
|
+
## 4.0.0-canary.45
|
|
227
|
+
|
|
228
|
+
### Patch Changes
|
|
229
|
+
|
|
230
|
+
- 0c4c275: trigger initial canary release
|
|
231
|
+
- Updated dependencies [0c4c275]
|
|
232
|
+
- @ai-sdk/provider-utils@5.0.0-canary.31
|
|
233
|
+
- @ai-sdk/provider@4.0.0-canary.15
|
|
234
|
+
|
|
235
|
+
## 4.0.0-beta.44
|
|
236
|
+
|
|
237
|
+
### Patch Changes
|
|
238
|
+
|
|
239
|
+
- bada0f3: feat(openai): preserve `namespace` on function_call output items
|
|
240
|
+
|
|
241
|
+
## 4.0.0-beta.43
|
|
242
|
+
|
|
243
|
+
### Patch Changes
|
|
244
|
+
|
|
245
|
+
- 9ea40e0: chore(provider/openai): add type for image model options for type-safe processing
|
|
246
|
+
|
|
247
|
+
## 4.0.0-beta.42
|
|
248
|
+
|
|
249
|
+
### Major Changes
|
|
250
|
+
|
|
251
|
+
- 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
|
|
252
|
+
|
|
253
|
+
For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
|
|
254
|
+
|
|
255
|
+
### Patch Changes
|
|
256
|
+
|
|
257
|
+
- Updated dependencies [08d2129]
|
|
258
|
+
- @ai-sdk/provider-utils@5.0.0-beta.30
|
|
259
|
+
|
|
260
|
+
## 4.0.0-beta.41
|
|
261
|
+
|
|
262
|
+
### Patch Changes
|
|
263
|
+
|
|
264
|
+
- 9bd6512: feat(provider): change file part data property to be tagged with a type and remove the image part type
|
|
265
|
+
- 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
|
|
266
|
+
- Updated dependencies [9bd6512]
|
|
267
|
+
- Updated dependencies [258c093]
|
|
268
|
+
- Updated dependencies [b6783da]
|
|
269
|
+
- @ai-sdk/provider-utils@5.0.0-beta.29
|
|
270
|
+
- @ai-sdk/provider@4.0.0-beta.14
|
|
271
|
+
|
|
272
|
+
## 4.0.0-beta.40
|
|
273
|
+
|
|
274
|
+
### Patch Changes
|
|
275
|
+
|
|
276
|
+
- 9f0e36c: trigger release for all packages after provenance setup
|
|
277
|
+
- Updated dependencies [9f0e36c]
|
|
278
|
+
- @ai-sdk/provider@4.0.0-beta.13
|
|
279
|
+
- @ai-sdk/provider-utils@5.0.0-beta.28
|
|
280
|
+
|
|
281
|
+
## 4.0.0-beta.39
|
|
282
|
+
|
|
283
|
+
### Patch Changes
|
|
284
|
+
|
|
285
|
+
- 58a2ad7: fix: more precise default message for tool execution denial
|
|
286
|
+
- f9acbc0: feat(provider/openai): add gpt-image-2 model support
|
|
287
|
+
- Updated dependencies [785fe16]
|
|
288
|
+
- Updated dependencies [67df0a0]
|
|
289
|
+
- Updated dependencies [befb78c]
|
|
290
|
+
- Updated dependencies [0458559]
|
|
291
|
+
- Updated dependencies [5852c0a]
|
|
292
|
+
- Updated dependencies [fc92055]
|
|
293
|
+
- @ai-sdk/provider-utils@5.0.0-beta.27
|
|
294
|
+
|
|
295
|
+
## 4.0.0-beta.38
|
|
296
|
+
|
|
297
|
+
### Patch Changes
|
|
298
|
+
|
|
299
|
+
- bfb756d: patch - send content: null instead of empty string for tool-only assistant messages
|
|
300
|
+
- Updated dependencies [2e98477]
|
|
301
|
+
- @ai-sdk/provider-utils@5.0.0-beta.26
|
|
302
|
+
|
|
303
|
+
## 4.0.0-beta.37
|
|
304
|
+
|
|
305
|
+
### Patch Changes
|
|
306
|
+
|
|
307
|
+
- Updated dependencies [eea8d98]
|
|
308
|
+
- @ai-sdk/provider-utils@5.0.0-beta.25
|
|
309
|
+
|
|
310
|
+
## 4.0.0-beta.36
|
|
311
|
+
|
|
312
|
+
### Patch Changes
|
|
313
|
+
|
|
314
|
+
- 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.
|
|
315
|
+
- Updated dependencies [f807e45]
|
|
316
|
+
- @ai-sdk/provider-utils@5.0.0-beta.24
|
|
317
|
+
|
|
318
|
+
## 4.0.0-beta.35
|
|
319
|
+
|
|
320
|
+
### Patch Changes
|
|
321
|
+
|
|
322
|
+
- Updated dependencies [350ea38]
|
|
323
|
+
- @ai-sdk/provider-utils@5.0.0-beta.23
|
|
324
|
+
|
|
325
|
+
## 4.0.0-beta.34
|
|
326
|
+
|
|
327
|
+
### Patch Changes
|
|
328
|
+
|
|
329
|
+
- Updated dependencies [083947b]
|
|
330
|
+
- @ai-sdk/provider-utils@5.0.0-beta.22
|
|
331
|
+
|
|
332
|
+
## 4.0.0-beta.33
|
|
333
|
+
|
|
334
|
+
### Patch Changes
|
|
335
|
+
|
|
336
|
+
- Updated dependencies [add1126]
|
|
337
|
+
- @ai-sdk/provider-utils@5.0.0-beta.21
|
|
338
|
+
|
|
339
|
+
## 4.0.0-beta.32
|
|
340
|
+
|
|
341
|
+
### Patch Changes
|
|
342
|
+
|
|
343
|
+
- 0c4ac8a: fix(openai): default undefined tool-call input to empty object before serializing tool arguments
|
|
344
|
+
|
|
345
|
+
## 4.0.0-beta.31
|
|
346
|
+
|
|
347
|
+
### Patch Changes
|
|
348
|
+
|
|
349
|
+
- b3976a2: Add workflow serialization support to all provider models.
|
|
350
|
+
|
|
351
|
+
**`@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.
|
|
352
|
+
|
|
353
|
+
**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.
|
|
354
|
+
|
|
355
|
+
All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
|
|
356
|
+
|
|
357
|
+
- ff5eba1: feat: roll `image-*` tool output types into their equivalent `file-*` types
|
|
358
|
+
- Updated dependencies [b3976a2]
|
|
359
|
+
- Updated dependencies [ff5eba1]
|
|
360
|
+
- @ai-sdk/provider-utils@5.0.0-beta.20
|
|
361
|
+
- @ai-sdk/provider@4.0.0-beta.12
|
|
362
|
+
|
|
363
|
+
## 4.0.0-beta.30
|
|
364
|
+
|
|
365
|
+
### Major Changes
|
|
366
|
+
|
|
367
|
+
- ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
|
|
368
|
+
|
|
369
|
+
### Patch Changes
|
|
370
|
+
|
|
371
|
+
- Updated dependencies [ef992f8]
|
|
372
|
+
- @ai-sdk/provider@4.0.0-beta.11
|
|
373
|
+
- @ai-sdk/provider-utils@5.0.0-beta.19
|
|
374
|
+
|
|
375
|
+
## 4.0.0-beta.29
|
|
376
|
+
|
|
377
|
+
### Patch Changes
|
|
378
|
+
|
|
379
|
+
- 90e2d8a: chore: fix unused vars not being flagged by our lint tooling
|
|
380
|
+
- Updated dependencies [90e2d8a]
|
|
381
|
+
- @ai-sdk/provider-utils@5.0.0-beta.18
|
|
382
|
+
|
|
383
|
+
## 4.0.0-beta.28
|
|
384
|
+
|
|
385
|
+
### Patch Changes
|
|
386
|
+
|
|
387
|
+
- Updated dependencies [3ae1786]
|
|
388
|
+
- @ai-sdk/provider-utils@5.0.0-beta.17
|
|
389
|
+
|
|
390
|
+
## 4.0.0-beta.27
|
|
391
|
+
|
|
392
|
+
### Patch Changes
|
|
393
|
+
|
|
394
|
+
- Updated dependencies [176466a]
|
|
395
|
+
- @ai-sdk/provider@4.0.0-beta.10
|
|
396
|
+
- @ai-sdk/provider-utils@5.0.0-beta.16
|
|
397
|
+
|
|
398
|
+
## 4.0.0-beta.26
|
|
399
|
+
|
|
400
|
+
### Patch Changes
|
|
401
|
+
|
|
402
|
+
- e311194: feat(ai): allow passing provider instance to `uploadFile` and `uploadSkill` as shorthand
|
|
403
|
+
- Updated dependencies [e311194]
|
|
404
|
+
- @ai-sdk/provider@4.0.0-beta.9
|
|
405
|
+
- @ai-sdk/provider-utils@5.0.0-beta.15
|
|
406
|
+
|
|
407
|
+
## 4.0.0-beta.25
|
|
408
|
+
|
|
409
|
+
### Patch Changes
|
|
410
|
+
|
|
411
|
+
- 34bd95d: feat(ai): add support for uploading provider skills using the provider references abstraction
|
|
412
|
+
- Updated dependencies [34bd95d]
|
|
413
|
+
- Updated dependencies [008271d]
|
|
414
|
+
- @ai-sdk/provider@4.0.0-beta.8
|
|
415
|
+
- @ai-sdk/provider-utils@5.0.0-beta.14
|
|
416
|
+
|
|
417
|
+
## 4.0.0-beta.24
|
|
418
|
+
|
|
419
|
+
### Patch Changes
|
|
420
|
+
|
|
421
|
+
- Updated dependencies [b0c2869]
|
|
422
|
+
- Updated dependencies [7e26e81]
|
|
423
|
+
- @ai-sdk/provider-utils@5.0.0-beta.13
|
|
424
|
+
|
|
425
|
+
## 4.0.0-beta.23
|
|
426
|
+
|
|
427
|
+
### Patch Changes
|
|
428
|
+
|
|
429
|
+
- Updated dependencies [46d1149]
|
|
430
|
+
- @ai-sdk/provider-utils@5.0.0-beta.12
|
|
431
|
+
|
|
432
|
+
## 4.0.0-beta.22
|
|
433
|
+
|
|
434
|
+
### Patch Changes
|
|
435
|
+
|
|
436
|
+
- 6fd51c0: fix(provider): preserve error type prefix in getErrorMessage
|
|
437
|
+
- Updated dependencies [6fd51c0]
|
|
438
|
+
- @ai-sdk/provider-utils@5.0.0-beta.11
|
|
439
|
+
- @ai-sdk/provider@4.0.0-beta.7
|
|
440
|
+
|
|
441
|
+
## 4.0.0-beta.21
|
|
442
|
+
|
|
443
|
+
### Patch Changes
|
|
444
|
+
|
|
445
|
+
- c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
|
|
446
|
+
- Updated dependencies [c29a26f]
|
|
447
|
+
- @ai-sdk/provider-utils@5.0.0-beta.10
|
|
448
|
+
- @ai-sdk/provider@4.0.0-beta.6
|
|
449
|
+
|
|
450
|
+
## 4.0.0-beta.20
|
|
451
|
+
|
|
452
|
+
### Patch Changes
|
|
453
|
+
|
|
454
|
+
- 38fc777: Add AI Gateway hint to provider READMEs
|
|
455
|
+
|
|
456
|
+
## 4.0.0-beta.19
|
|
457
|
+
|
|
458
|
+
### Patch Changes
|
|
459
|
+
|
|
460
|
+
- Updated dependencies [2e17091]
|
|
461
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
462
|
+
|
|
463
|
+
## 4.0.0-beta.18
|
|
464
|
+
|
|
465
|
+
### Patch Changes
|
|
466
|
+
|
|
467
|
+
- Updated dependencies [986c6fd]
|
|
468
|
+
- Updated dependencies [493295c]
|
|
469
|
+
- @ai-sdk/provider-utils@5.0.0-beta.8
|
|
470
|
+
|
|
471
|
+
## 4.0.0-beta.17
|
|
472
|
+
|
|
473
|
+
### Patch Changes
|
|
474
|
+
|
|
475
|
+
- 817a1a6: fix(openai): support file-url parts in tool output content
|
|
476
|
+
|
|
477
|
+
## 4.0.0-beta.16
|
|
478
|
+
|
|
479
|
+
### Patch Changes
|
|
480
|
+
|
|
481
|
+
- 1f509d4: fix(ai): force template check on 'kind' param
|
|
482
|
+
- Updated dependencies [1f509d4]
|
|
483
|
+
- @ai-sdk/provider-utils@5.0.0-beta.7
|
|
484
|
+
- @ai-sdk/provider@4.0.0-beta.5
|
|
485
|
+
|
|
486
|
+
## 4.0.0-beta.15
|
|
487
|
+
|
|
488
|
+
### Patch Changes
|
|
489
|
+
|
|
490
|
+
- 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.
|
|
491
|
+
|
|
492
|
+
## 4.0.0-beta.14
|
|
493
|
+
|
|
494
|
+
### Patch Changes
|
|
495
|
+
|
|
496
|
+
- e6376c2: fix(openai): preserve raw finish reason for failed responses stream events
|
|
497
|
+
|
|
498
|
+
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`.
|
|
499
|
+
|
|
500
|
+
## 4.0.0-beta.13
|
|
501
|
+
|
|
502
|
+
### Patch Changes
|
|
503
|
+
|
|
504
|
+
- 3887c70: feat(provider): add new top-level reasoning parameter to spec and support it in `generateText` and `streamText`
|
|
505
|
+
- Updated dependencies [3887c70]
|
|
506
|
+
- @ai-sdk/provider-utils@5.0.0-beta.6
|
|
507
|
+
- @ai-sdk/provider@4.0.0-beta.4
|
|
508
|
+
|
|
509
|
+
## 4.0.0-beta.12
|
|
510
|
+
|
|
511
|
+
### Patch Changes
|
|
512
|
+
|
|
513
|
+
- d9a1e9a: feat(openai): add server side compaction for openai
|
|
514
|
+
|
|
515
|
+
## 4.0.0-beta.11
|
|
516
|
+
|
|
517
|
+
### Patch Changes
|
|
518
|
+
|
|
519
|
+
- Updated dependencies [776b617]
|
|
520
|
+
- @ai-sdk/provider-utils@5.0.0-beta.5
|
|
521
|
+
- @ai-sdk/provider@4.0.0-beta.3
|
|
522
|
+
|
|
523
|
+
## 4.0.0-beta.10
|
|
524
|
+
|
|
525
|
+
### Major Changes
|
|
526
|
+
|
|
527
|
+
- 61753c3: ### `@ai-sdk/openai`: remove redundant `name` argument from `openai.tools.customTool()`
|
|
528
|
+
|
|
529
|
+
`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).
|
|
530
|
+
|
|
531
|
+
migration: remove the `name` property from `customTool()` calls. the object key is now used as the tool name sent to the openai api.
|
|
532
|
+
|
|
533
|
+
before:
|
|
534
|
+
|
|
535
|
+
```ts
|
|
536
|
+
tools: {
|
|
537
|
+
write_sql: openai.tools.customTool({
|
|
538
|
+
name: 'write_sql',
|
|
539
|
+
description: '...',
|
|
540
|
+
}),
|
|
541
|
+
}
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
after:
|
|
545
|
+
|
|
546
|
+
```ts
|
|
547
|
+
tools: {
|
|
548
|
+
write_sql: openai.tools.customTool({
|
|
549
|
+
description: '...',
|
|
550
|
+
}),
|
|
551
|
+
}
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
### `@ai-sdk/provider-utils`: `createToolNameMapping()` no longer accepts the `resolveProviderToolName` parameter
|
|
555
|
+
|
|
556
|
+
before: tool name can be set dynamically
|
|
557
|
+
|
|
558
|
+
```ts
|
|
559
|
+
const toolNameMapping = createToolNameMapping({
|
|
560
|
+
tools,
|
|
561
|
+
providerToolNames: {
|
|
562
|
+
"openai.code_interpreter": "code_interpreter",
|
|
563
|
+
"openai.file_search": "file_search",
|
|
564
|
+
"openai.image_generation": "image_generation",
|
|
565
|
+
"openai.local_shell": "local_shell",
|
|
566
|
+
"openai.shell": "shell",
|
|
567
|
+
"openai.web_search": "web_search",
|
|
568
|
+
"openai.web_search_preview": "web_search_preview",
|
|
569
|
+
"openai.mcp": "mcp",
|
|
570
|
+
"openai.apply_patch": "apply_patch",
|
|
571
|
+
},
|
|
572
|
+
resolveProviderToolName: (tool) =>
|
|
573
|
+
tool.id === "openai.custom"
|
|
574
|
+
? (tool.args as { name?: string }).name
|
|
575
|
+
: undefined,
|
|
576
|
+
});
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
after: tool name is static based on `tools` keys
|
|
580
|
+
|
|
581
|
+
```
|
|
582
|
+
const toolNameMapping = createToolNameMapping({
|
|
583
|
+
tools,
|
|
584
|
+
providerToolNames: {
|
|
585
|
+
'openai.code_interpreter': 'code_interpreter',
|
|
586
|
+
'openai.file_search': 'file_search',
|
|
587
|
+
'openai.image_generation': 'image_generation',
|
|
588
|
+
'openai.local_shell': 'local_shell',
|
|
589
|
+
'openai.shell': 'shell',
|
|
590
|
+
'openai.web_search': 'web_search',
|
|
591
|
+
'openai.web_search_preview': 'web_search_preview',
|
|
592
|
+
'openai.mcp': 'mcp',
|
|
593
|
+
'openai.apply_patch': 'apply_patch',
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
### Patch Changes
|
|
599
|
+
|
|
600
|
+
- Updated dependencies [61753c3]
|
|
601
|
+
- @ai-sdk/provider-utils@5.0.0-beta.4
|
|
602
|
+
|
|
603
|
+
## 4.0.0-beta.9
|
|
604
|
+
|
|
605
|
+
### Patch Changes
|
|
606
|
+
|
|
607
|
+
- 156cdf0: feat(openai): add new tool search tool
|
|
608
|
+
|
|
609
|
+
## 4.0.0-beta.8
|
|
610
|
+
|
|
611
|
+
### Patch Changes
|
|
612
|
+
|
|
613
|
+
- Updated dependencies [f7d4f01]
|
|
614
|
+
- @ai-sdk/provider-utils@5.0.0-beta.3
|
|
615
|
+
- @ai-sdk/provider@4.0.0-beta.2
|
|
616
|
+
|
|
617
|
+
## 4.0.0-beta.7
|
|
618
|
+
|
|
619
|
+
### Patch Changes
|
|
620
|
+
|
|
621
|
+
- Updated dependencies [5c2a5a2]
|
|
622
|
+
- @ai-sdk/provider@4.0.0-beta.1
|
|
623
|
+
- @ai-sdk/provider-utils@5.0.0-beta.2
|
|
624
|
+
|
|
3
625
|
## 4.0.0-beta.6
|
|
4
626
|
|
|
5
627
|
### Patch Changes
|
|
@@ -222,7 +844,6 @@
|
|
|
222
844
|
### Patch Changes
|
|
223
845
|
|
|
224
846
|
- 04c89b1: Provide Responses API providerMetadata types at the message / reasoning level.
|
|
225
|
-
|
|
226
847
|
- Export the following types for use in client code:
|
|
227
848
|
- `OpenaiResponsesProviderMetadata`
|
|
228
849
|
- `OpenaiResponsesReasoningProviderMetadata`
|
|
@@ -303,7 +924,6 @@
|
|
|
303
924
|
### Patch Changes
|
|
304
925
|
|
|
305
926
|
- 330bd92: Fix Responses `code_interpreter` annotations and add typed providerMetadata
|
|
306
|
-
|
|
307
927
|
- Align Responses API `code_interpreter` annotation types with the official spec.
|
|
308
928
|
- Add tests to ensure the overlapping parts of the Zod schemas used by `doGenerate` and `doStream` stay in sync.
|
|
309
929
|
- Export the following types for use in client code:
|
|
@@ -388,13 +1008,13 @@
|
|
|
388
1008
|
Before
|
|
389
1009
|
|
|
390
1010
|
```ts
|
|
391
|
-
model.textEmbeddingModel(
|
|
1011
|
+
model.textEmbeddingModel("my-model-id");
|
|
392
1012
|
```
|
|
393
1013
|
|
|
394
1014
|
After
|
|
395
1015
|
|
|
396
1016
|
```ts
|
|
397
|
-
model.embeddingModel(
|
|
1017
|
+
model.embeddingModel("my-model-id");
|
|
398
1018
|
```
|
|
399
1019
|
|
|
400
1020
|
- 60f4775: fix: remove code for unsuported o1-mini and o1-preview models
|
|
@@ -404,15 +1024,15 @@
|
|
|
404
1024
|
- 2e86082: feat(provider/openai): `OpenAIChatLanguageModelOptions` type
|
|
405
1025
|
|
|
406
1026
|
```ts
|
|
407
|
-
import { openai, type OpenAIChatLanguageModelOptions } from
|
|
408
|
-
import { generateText } from
|
|
1027
|
+
import { openai, type OpenAIChatLanguageModelOptions } from "@ai-sdk/openai";
|
|
1028
|
+
import { generateText } from "ai";
|
|
409
1029
|
|
|
410
1030
|
await generateText({
|
|
411
|
-
model: openai.chat(
|
|
412
|
-
prompt:
|
|
1031
|
+
model: openai.chat("gpt-4o"),
|
|
1032
|
+
prompt: "Invent a new holiday and describe its traditions.",
|
|
413
1033
|
providerOptions: {
|
|
414
1034
|
openai: {
|
|
415
|
-
user:
|
|
1035
|
+
user: "user-123",
|
|
416
1036
|
} satisfies OpenAIChatLanguageModelOptions,
|
|
417
1037
|
},
|
|
418
1038
|
});
|
|
@@ -813,13 +1433,13 @@
|
|
|
813
1433
|
Before
|
|
814
1434
|
|
|
815
1435
|
```ts
|
|
816
|
-
model.textEmbeddingModel(
|
|
1436
|
+
model.textEmbeddingModel("my-model-id");
|
|
817
1437
|
```
|
|
818
1438
|
|
|
819
1439
|
After
|
|
820
1440
|
|
|
821
1441
|
```ts
|
|
822
|
-
model.embeddingModel(
|
|
1442
|
+
model.embeddingModel("my-model-id");
|
|
823
1443
|
```
|
|
824
1444
|
|
|
825
1445
|
- Updated dependencies [8d9e8ad]
|
|
@@ -1289,15 +1909,15 @@
|
|
|
1289
1909
|
- 2e86082: feat(provider/openai): `OpenAIChatLanguageModelOptions` type
|
|
1290
1910
|
|
|
1291
1911
|
```ts
|
|
1292
|
-
import { openai, type OpenAIChatLanguageModelOptions } from
|
|
1293
|
-
import { generateText } from
|
|
1912
|
+
import { openai, type OpenAIChatLanguageModelOptions } from "@ai-sdk/openai";
|
|
1913
|
+
import { generateText } from "ai";
|
|
1294
1914
|
|
|
1295
1915
|
await generateText({
|
|
1296
|
-
model: openai.chat(
|
|
1297
|
-
prompt:
|
|
1916
|
+
model: openai.chat("gpt-4o"),
|
|
1917
|
+
prompt: "Invent a new holiday and describe its traditions.",
|
|
1298
1918
|
providerOptions: {
|
|
1299
1919
|
openai: {
|
|
1300
|
-
user:
|
|
1920
|
+
user: "user-123",
|
|
1301
1921
|
} satisfies OpenAIChatLanguageModelOptions,
|
|
1302
1922
|
},
|
|
1303
1923
|
});
|
|
@@ -1593,7 +2213,7 @@
|
|
|
1593
2213
|
|
|
1594
2214
|
```js
|
|
1595
2215
|
await generateImage({
|
|
1596
|
-
model: luma.image(
|
|
2216
|
+
model: luma.image("photon-flash-1", {
|
|
1597
2217
|
maxImagesPerCall: 5,
|
|
1598
2218
|
pollIntervalMillis: 500,
|
|
1599
2219
|
}),
|
|
@@ -1606,7 +2226,7 @@
|
|
|
1606
2226
|
|
|
1607
2227
|
```js
|
|
1608
2228
|
await generateImage({
|
|
1609
|
-
model: luma.image(
|
|
2229
|
+
model: luma.image("photon-flash-1"),
|
|
1610
2230
|
prompt,
|
|
1611
2231
|
n: 10,
|
|
1612
2232
|
maxImagesPerCall: 5,
|
|
@@ -1668,10 +2288,10 @@
|
|
|
1668
2288
|
The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
|
|
1669
2289
|
|
|
1670
2290
|
```js
|
|
1671
|
-
const prompt =
|
|
2291
|
+
const prompt = "Santa Claus driving a Cadillac";
|
|
1672
2292
|
|
|
1673
2293
|
const { providerMetadata } = await experimental_generateImage({
|
|
1674
|
-
model: openai.image(
|
|
2294
|
+
model: openai.image("dall-e-3"),
|
|
1675
2295
|
prompt,
|
|
1676
2296
|
});
|
|
1677
2297
|
|
|
@@ -1970,7 +2590,7 @@
|
|
|
1970
2590
|
|
|
1971
2591
|
```js
|
|
1972
2592
|
await generateImage({
|
|
1973
|
-
model: luma.image(
|
|
2593
|
+
model: luma.image("photon-flash-1", {
|
|
1974
2594
|
maxImagesPerCall: 5,
|
|
1975
2595
|
pollIntervalMillis: 500,
|
|
1976
2596
|
}),
|
|
@@ -1983,7 +2603,7 @@
|
|
|
1983
2603
|
|
|
1984
2604
|
```js
|
|
1985
2605
|
await generateImage({
|
|
1986
|
-
model: luma.image(
|
|
2606
|
+
model: luma.image("photon-flash-1"),
|
|
1987
2607
|
prompt,
|
|
1988
2608
|
n: 10,
|
|
1989
2609
|
maxImagesPerCall: 5,
|
|
@@ -2028,10 +2648,10 @@
|
|
|
2028
2648
|
The `experimental_generateImage` method from the `ai` package now returnes revised prompts for OpenAI's image models.
|
|
2029
2649
|
|
|
2030
2650
|
```js
|
|
2031
|
-
const prompt =
|
|
2651
|
+
const prompt = "Santa Claus driving a Cadillac";
|
|
2032
2652
|
|
|
2033
2653
|
const { providerMetadata } = await experimental_generateImage({
|
|
2034
|
-
model: openai.image(
|
|
2654
|
+
model: openai.image("dall-e-3"),
|
|
2035
2655
|
prompt,
|
|
2036
2656
|
});
|
|
2037
2657
|
|