@ai-sdk/openai 0.0.54 → 0.0.55

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 ADDED
@@ -0,0 +1,428 @@
1
+ # @ai-sdk/openai
2
+
3
+ ## 0.0.55
4
+
5
+ ### Patch Changes
6
+
7
+ - 28cbf2e: fix (provider/openai): support tool call deltas when arguments are sent in the first chunk
8
+
9
+ ## 0.0.54
10
+
11
+ ### Patch Changes
12
+
13
+ - 26515cb: feat (ai/provider): introduce ProviderV1 specification
14
+ - Updated dependencies [26515cb]
15
+ - @ai-sdk/provider@0.0.22
16
+ - @ai-sdk/provider-utils@1.0.17
17
+
18
+ ## 0.0.53
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [09f895f]
23
+ - @ai-sdk/provider-utils@1.0.16
24
+
25
+ ## 0.0.52
26
+
27
+ ### Patch Changes
28
+
29
+ - d5b6a15: feat (provider/openai): support partial usage information
30
+
31
+ ## 0.0.51
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies [d67fa9c]
36
+ - @ai-sdk/provider-utils@1.0.15
37
+
38
+ ## 0.0.50
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [f2c025e]
43
+ - @ai-sdk/provider@0.0.21
44
+ - @ai-sdk/provider-utils@1.0.14
45
+
46
+ ## 0.0.49
47
+
48
+ ### Patch Changes
49
+
50
+ - f42d9bd: fix (provider/openai): support OpenRouter streaming errors
51
+
52
+ ## 0.0.48
53
+
54
+ ### Patch Changes
55
+
56
+ - Updated dependencies [6ac355e]
57
+ - @ai-sdk/provider@0.0.20
58
+ - @ai-sdk/provider-utils@1.0.13
59
+
60
+ ## 0.0.47
61
+
62
+ ### Patch Changes
63
+
64
+ - 4ffbaee: fix (provider/openai): fix strict flag for structured outputs with tools
65
+ - dd712ac: fix: use FetchFunction type to prevent self-reference
66
+ - Updated dependencies [dd712ac]
67
+ - @ai-sdk/provider-utils@1.0.12
68
+
69
+ ## 0.0.46
70
+
71
+ ### Patch Changes
72
+
73
+ - 89b18ca: fix (ai/provider): send finish reason 'unknown' by default
74
+ - Updated dependencies [dd4a0f5]
75
+ - @ai-sdk/provider@0.0.19
76
+ - @ai-sdk/provider-utils@1.0.11
77
+
78
+ ## 0.0.45
79
+
80
+ ### Patch Changes
81
+
82
+ - Updated dependencies [4bd27a9]
83
+ - Updated dependencies [845754b]
84
+ - @ai-sdk/provider-utils@1.0.10
85
+ - @ai-sdk/provider@0.0.18
86
+
87
+ ## 0.0.44
88
+
89
+ ### Patch Changes
90
+
91
+ - 029af4c: feat (ai/core): support schema name & description in generateObject & streamObject
92
+ - Updated dependencies [029af4c]
93
+ - @ai-sdk/provider@0.0.17
94
+ - @ai-sdk/provider-utils@1.0.9
95
+
96
+ ## 0.0.43
97
+
98
+ ### Patch Changes
99
+
100
+ - d58517b: feat (ai/openai): structured outputs
101
+ - c0a73ee: feat (provider/openai): add gpt-4o-2024-08-06 to list of supported models
102
+ - Updated dependencies [d58517b]
103
+ - @ai-sdk/provider@0.0.16
104
+ - @ai-sdk/provider-utils@1.0.8
105
+
106
+ ## 0.0.42
107
+
108
+ ### Patch Changes
109
+
110
+ - Updated dependencies [96aed25]
111
+ - @ai-sdk/provider@0.0.15
112
+ - @ai-sdk/provider-utils@1.0.7
113
+
114
+ ## 0.0.41
115
+
116
+ ### Patch Changes
117
+
118
+ - 7a2eb27: feat (provider/openai): make role nullish to enhance provider support
119
+ - Updated dependencies [9614584]
120
+ - Updated dependencies [0762a22]
121
+ - @ai-sdk/provider-utils@1.0.6
122
+
123
+ ## 0.0.40
124
+
125
+ ### Patch Changes
126
+
127
+ - Updated dependencies [a8d1c9e9]
128
+ - @ai-sdk/provider-utils@1.0.5
129
+ - @ai-sdk/provider@0.0.14
130
+
131
+ ## 0.0.39
132
+
133
+ ### Patch Changes
134
+
135
+ - Updated dependencies [4f88248f]
136
+ - @ai-sdk/provider-utils@1.0.4
137
+
138
+ ## 0.0.38
139
+
140
+ ### Patch Changes
141
+
142
+ - 2b9da0f0: feat (core): support stopSequences setting.
143
+ - 909b9d27: feat (ai/openai): Support legacy function calls
144
+ - a5b58845: feat (core): support topK setting
145
+ - 4aa8deb3: feat (provider): support responseFormat setting in provider api
146
+ - 13b27ec6: chore (ai/core): remove grammar mode
147
+ - Updated dependencies [2b9da0f0]
148
+ - Updated dependencies [a5b58845]
149
+ - Updated dependencies [4aa8deb3]
150
+ - Updated dependencies [13b27ec6]
151
+ - @ai-sdk/provider@0.0.13
152
+ - @ai-sdk/provider-utils@1.0.3
153
+
154
+ ## 0.0.37
155
+
156
+ ### Patch Changes
157
+
158
+ - 89947fc5: chore (provider/openai): update model list for type-ahead support
159
+
160
+ ## 0.0.36
161
+
162
+ ### Patch Changes
163
+
164
+ - b7290943: feat (ai/core): add token usage to embed and embedMany
165
+ - Updated dependencies [b7290943]
166
+ - @ai-sdk/provider@0.0.12
167
+ - @ai-sdk/provider-utils@1.0.2
168
+
169
+ ## 0.0.35
170
+
171
+ ### Patch Changes
172
+
173
+ - Updated dependencies [d481729f]
174
+ - @ai-sdk/provider-utils@1.0.1
175
+
176
+ ## 0.0.34
177
+
178
+ ### Patch Changes
179
+
180
+ - 5edc6110: feat (ai/core): add custom request header support
181
+ - Updated dependencies [5edc6110]
182
+ - Updated dependencies [5edc6110]
183
+ - Updated dependencies [5edc6110]
184
+ - @ai-sdk/provider@0.0.11
185
+ - @ai-sdk/provider-utils@1.0.0
186
+
187
+ ## 0.0.33
188
+
189
+ ### Patch Changes
190
+
191
+ - Updated dependencies [02f6a088]
192
+ - @ai-sdk/provider-utils@0.0.16
193
+
194
+ ## 0.0.32
195
+
196
+ ### Patch Changes
197
+
198
+ - 1b37b8b9: fix (@ai-sdk/openai): only send logprobs settings when logprobs are requested
199
+
200
+ ## 0.0.31
201
+
202
+ ### Patch Changes
203
+
204
+ - eba071dd: feat (@ai-sdk/azure): add azure openai completion support
205
+ - 1ea890fe: feat (@ai-sdk/azure): add azure openai completion support
206
+
207
+ ## 0.0.30
208
+
209
+ ### Patch Changes
210
+
211
+ - Updated dependencies [85712895]
212
+ - Updated dependencies [85712895]
213
+ - @ai-sdk/provider-utils@0.0.15
214
+
215
+ ## 0.0.29
216
+
217
+ ### Patch Changes
218
+
219
+ - 4728c37f: feat (core): add text embedding model support to provider registry
220
+ - 7910ae84: feat (providers): support custom fetch implementations
221
+ - Updated dependencies [7910ae84]
222
+ - @ai-sdk/provider-utils@0.0.14
223
+
224
+ ## 0.0.28
225
+
226
+ ### Patch Changes
227
+
228
+ - f9db8fd6: feat (@ai-sdk/openai): add parallelToolCalls setting
229
+
230
+ ## 0.0.27
231
+
232
+ ### Patch Changes
233
+
234
+ - fc9552ec: fix (@ai-sdk/azure): allow for nullish delta
235
+
236
+ ## 0.0.26
237
+
238
+ ### Patch Changes
239
+
240
+ - 7530f861: fix (@ai-sdk/openai): add internal dist to bundle
241
+
242
+ ## 0.0.25
243
+
244
+ ### Patch Changes
245
+
246
+ - 8b1362a7: chore (@ai-sdk/openai): expose models under /internal for reuse in other providers
247
+
248
+ ## 0.0.24
249
+
250
+ ### Patch Changes
251
+
252
+ - 0e78960c: fix (@ai-sdk/openai): make function name and arguments nullish
253
+
254
+ ## 0.0.23
255
+
256
+ ### Patch Changes
257
+
258
+ - a68fe74a: fix (@ai-sdk/openai): allow null tool_calls value.
259
+
260
+ ## 0.0.22
261
+
262
+ ### Patch Changes
263
+
264
+ - Updated dependencies [102ca22f]
265
+ - @ai-sdk/provider@0.0.10
266
+ - @ai-sdk/provider-utils@0.0.13
267
+
268
+ ## 0.0.21
269
+
270
+ ### Patch Changes
271
+
272
+ - fca7d026: feat (provider/openai): support streaming tool calls that are sent in one chunk
273
+ - Updated dependencies [09295e2e]
274
+ - Updated dependencies [09295e2e]
275
+ - Updated dependencies [043a5de2]
276
+ - @ai-sdk/provider@0.0.9
277
+ - @ai-sdk/provider-utils@0.0.12
278
+
279
+ ## 0.0.20
280
+
281
+ ### Patch Changes
282
+
283
+ - a1d08f3e: fix (provider/openai): handle error chunks when streaming
284
+
285
+ ## 0.0.19
286
+
287
+ ### Patch Changes
288
+
289
+ - beb8b739: fix (provider/openai): return unknown finish reasons as unknown
290
+
291
+ ## 0.0.18
292
+
293
+ ### Patch Changes
294
+
295
+ - fb42e760: feat (provider/openai): send user message content as text when possible
296
+
297
+ ## 0.0.17
298
+
299
+ ### Patch Changes
300
+
301
+ - f39c0dd2: feat (provider): implement toolChoice support
302
+ - Updated dependencies [f39c0dd2]
303
+ - @ai-sdk/provider@0.0.8
304
+ - @ai-sdk/provider-utils@0.0.11
305
+
306
+ ## 0.0.16
307
+
308
+ ### Patch Changes
309
+
310
+ - 2b18fa11: fix (provider/openai): remove object type validation
311
+
312
+ ## 0.0.15
313
+
314
+ ### Patch Changes
315
+
316
+ - 24683b72: fix (providers): Zod is required dependency
317
+ - Updated dependencies [8e780288]
318
+ - @ai-sdk/provider@0.0.7
319
+ - @ai-sdk/provider-utils@0.0.10
320
+
321
+ ## 0.0.14
322
+
323
+ ### Patch Changes
324
+
325
+ - Updated dependencies [6a50ac4]
326
+ - Updated dependencies [6a50ac4]
327
+ - @ai-sdk/provider@0.0.6
328
+ - @ai-sdk/provider-utils@0.0.9
329
+
330
+ ## 0.0.13
331
+
332
+ ### Patch Changes
333
+
334
+ - 4e3c922: fix (provider/openai): introduce compatibility mode in which "stream_options" are not sent
335
+
336
+ ## 0.0.12
337
+
338
+ ### Patch Changes
339
+
340
+ - 6f48839: feat (provider/openai): add gpt-4o to the list of supported models
341
+ - 1009594: feat (provider/openai): set stream_options/include_usage to true when streaming
342
+ - 0f6bc4e: feat (ai/core): add embed function
343
+ - Updated dependencies [0f6bc4e]
344
+ - @ai-sdk/provider@0.0.5
345
+ - @ai-sdk/provider-utils@0.0.8
346
+
347
+ ## 0.0.11
348
+
349
+ ### Patch Changes
350
+
351
+ - Updated dependencies [325ca55]
352
+ - @ai-sdk/provider@0.0.4
353
+ - @ai-sdk/provider-utils@0.0.7
354
+
355
+ ## 0.0.10
356
+
357
+ ### Patch Changes
358
+
359
+ - Updated dependencies [276f22b]
360
+ - @ai-sdk/provider-utils@0.0.6
361
+
362
+ ## 0.0.9
363
+
364
+ ### Patch Changes
365
+
366
+ - Updated dependencies [41d5736]
367
+ - @ai-sdk/provider@0.0.3
368
+ - @ai-sdk/provider-utils@0.0.5
369
+
370
+ ## 0.0.8
371
+
372
+ ### Patch Changes
373
+
374
+ - Updated dependencies [56ef84a]
375
+ - @ai-sdk/provider-utils@0.0.4
376
+
377
+ ## 0.0.7
378
+
379
+ ### Patch Changes
380
+
381
+ - 0833e19: Allow optional content to support Fireworks function calling.
382
+
383
+ ## 0.0.6
384
+
385
+ ### Patch Changes
386
+
387
+ - d6431ae: ai/core: add logprobs support (thanks @SamStenner for the contribution)
388
+ - 25f3350: ai/core: add support for getting raw response headers.
389
+ - Updated dependencies [d6431ae]
390
+ - Updated dependencies [25f3350]
391
+ - @ai-sdk/provider@0.0.2
392
+ - @ai-sdk/provider-utils@0.0.3
393
+
394
+ ## 0.0.5
395
+
396
+ ### Patch Changes
397
+
398
+ - eb150a6: ai/core: remove scaling of setting values (breaking change). If you were using the temperature, frequency penalty, or presence penalty settings, you need to update the providers and adjust the setting values.
399
+ - Updated dependencies [eb150a6]
400
+ - @ai-sdk/provider-utils@0.0.2
401
+ - @ai-sdk/provider@0.0.1
402
+
403
+ ## 0.0.4
404
+
405
+ ### Patch Changes
406
+
407
+ - c6fc35b: Add custom header and OpenAI project support.
408
+
409
+ ## 0.0.3
410
+
411
+ ### Patch Changes
412
+
413
+ - ab60b18: Simplified model construction by directly calling provider functions. Add create... functions to create provider instances.
414
+
415
+ ## 0.0.2
416
+
417
+ ### Patch Changes
418
+
419
+ - 2bff460: Fix build for release.
420
+
421
+ ## 0.0.1
422
+
423
+ ### Patch Changes
424
+
425
+ - 7b8791d: Support streams with 'chat.completion' objects.
426
+ - 7b8791d: Rename baseUrl to baseURL. Automatically remove trailing slashes.
427
+ - Updated dependencies [7b8791d]
428
+ - @ai-sdk/provider-utils@0.0.1
package/dist/index.js CHANGED
@@ -510,21 +510,25 @@ var OpenAIChatLanguageModel = class {
510
510
  }
511
511
  };
512
512
  const toolCall2 = toolCalls[index];
513
- if (((_e = toolCall2.function) == null ? void 0 : _e.name) != null && ((_f = toolCall2.function) == null ? void 0 : _f.arguments) != null && (0, import_provider_utils3.isParsableJson)(toolCall2.function.arguments)) {
514
- controller.enqueue({
515
- type: "tool-call-delta",
516
- toolCallType: "function",
517
- toolCallId: toolCall2.id,
518
- toolName: toolCall2.function.name,
519
- argsTextDelta: toolCall2.function.arguments
520
- });
521
- controller.enqueue({
522
- type: "tool-call",
523
- toolCallType: "function",
524
- toolCallId: (_g = toolCall2.id) != null ? _g : (0, import_provider_utils3.generateId)(),
525
- toolName: toolCall2.function.name,
526
- args: toolCall2.function.arguments
527
- });
513
+ if (((_e = toolCall2.function) == null ? void 0 : _e.name) != null && ((_f = toolCall2.function) == null ? void 0 : _f.arguments) != null) {
514
+ if (toolCall2.function.arguments.length > 0) {
515
+ controller.enqueue({
516
+ type: "tool-call-delta",
517
+ toolCallType: "function",
518
+ toolCallId: toolCall2.id,
519
+ toolName: toolCall2.function.name,
520
+ argsTextDelta: toolCall2.function.arguments
521
+ });
522
+ }
523
+ if ((0, import_provider_utils3.isParsableJson)(toolCall2.function.arguments)) {
524
+ controller.enqueue({
525
+ type: "tool-call",
526
+ toolCallType: "function",
527
+ toolCallId: (_g = toolCall2.id) != null ? _g : (0, import_provider_utils3.generateId)(),
528
+ toolName: toolCall2.function.name,
529
+ args: toolCall2.function.arguments
530
+ });
531
+ }
528
532
  }
529
533
  continue;
530
534
  }