@ai-sdk/openai 3.0.7 → 3.0.8
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 +14 -0
- package/dist/index.d.mts +375 -1
- package/dist/index.d.ts +375 -1
- package/dist/index.js +54 -60
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -60
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +406 -32
- package/dist/internal/index.d.ts +406 -32
- package/dist/internal/index.js +53 -59
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +53 -59
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 3.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 330bd92: Fix Responses `code_interpreter` annotations and add typed providerMetadata
|
|
8
|
+
|
|
9
|
+
- Align Responses API `code_interpreter` annotation types with the official spec.
|
|
10
|
+
- Add tests to ensure the overlapping parts of the Zod schemas used by `doGenerate` and `doStream` stay in sync.
|
|
11
|
+
- Export the following types for use in client code:
|
|
12
|
+
- `OpenaiResponsesTextProviderMetadata`
|
|
13
|
+
- `OpenaiResponsesSourceDocumentProviderMetadata`
|
|
14
|
+
- `AzureResponsesTextProviderMetadata`
|
|
15
|
+
- `AzureResponsesSourceDocumentProviderMetadata`
|
|
16
|
+
|
|
3
17
|
## 3.0.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -160,6 +160,352 @@ type OpenAIResponsesFileSearchToolCompoundFilter = {
|
|
|
160
160
|
*/
|
|
161
161
|
filters: Array<OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter>;
|
|
162
162
|
};
|
|
163
|
+
declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
164
|
+
type: "unknown_chunk";
|
|
165
|
+
message: string;
|
|
166
|
+
} | {
|
|
167
|
+
type: "response.output_text.delta";
|
|
168
|
+
item_id: string;
|
|
169
|
+
delta: string;
|
|
170
|
+
logprobs?: {
|
|
171
|
+
token: string;
|
|
172
|
+
logprob: number;
|
|
173
|
+
top_logprobs: {
|
|
174
|
+
token: string;
|
|
175
|
+
logprob: number;
|
|
176
|
+
}[];
|
|
177
|
+
}[] | null | undefined;
|
|
178
|
+
} | {
|
|
179
|
+
type: "response.completed" | "response.incomplete";
|
|
180
|
+
response: {
|
|
181
|
+
usage: {
|
|
182
|
+
input_tokens: number;
|
|
183
|
+
output_tokens: number;
|
|
184
|
+
input_tokens_details?: {
|
|
185
|
+
cached_tokens?: number | null | undefined;
|
|
186
|
+
} | null | undefined;
|
|
187
|
+
output_tokens_details?: {
|
|
188
|
+
reasoning_tokens?: number | null | undefined;
|
|
189
|
+
} | null | undefined;
|
|
190
|
+
};
|
|
191
|
+
incomplete_details?: {
|
|
192
|
+
reason: string;
|
|
193
|
+
} | null | undefined;
|
|
194
|
+
service_tier?: string | null | undefined;
|
|
195
|
+
};
|
|
196
|
+
} | {
|
|
197
|
+
type: "response.created";
|
|
198
|
+
response: {
|
|
199
|
+
id: string;
|
|
200
|
+
created_at: number;
|
|
201
|
+
model: string;
|
|
202
|
+
service_tier?: string | null | undefined;
|
|
203
|
+
};
|
|
204
|
+
} | {
|
|
205
|
+
type: "response.output_item.added";
|
|
206
|
+
output_index: number;
|
|
207
|
+
item: {
|
|
208
|
+
type: "message";
|
|
209
|
+
id: string;
|
|
210
|
+
} | {
|
|
211
|
+
type: "reasoning";
|
|
212
|
+
id: string;
|
|
213
|
+
encrypted_content?: string | null | undefined;
|
|
214
|
+
} | {
|
|
215
|
+
type: "function_call";
|
|
216
|
+
id: string;
|
|
217
|
+
call_id: string;
|
|
218
|
+
name: string;
|
|
219
|
+
arguments: string;
|
|
220
|
+
} | {
|
|
221
|
+
type: "web_search_call";
|
|
222
|
+
id: string;
|
|
223
|
+
status: string;
|
|
224
|
+
} | {
|
|
225
|
+
type: "computer_call";
|
|
226
|
+
id: string;
|
|
227
|
+
status: string;
|
|
228
|
+
} | {
|
|
229
|
+
type: "file_search_call";
|
|
230
|
+
id: string;
|
|
231
|
+
} | {
|
|
232
|
+
type: "image_generation_call";
|
|
233
|
+
id: string;
|
|
234
|
+
} | {
|
|
235
|
+
type: "code_interpreter_call";
|
|
236
|
+
id: string;
|
|
237
|
+
container_id: string;
|
|
238
|
+
code: string | null;
|
|
239
|
+
outputs: ({
|
|
240
|
+
type: "logs";
|
|
241
|
+
logs: string;
|
|
242
|
+
} | {
|
|
243
|
+
type: "image";
|
|
244
|
+
url: string;
|
|
245
|
+
})[] | null;
|
|
246
|
+
status: string;
|
|
247
|
+
} | {
|
|
248
|
+
type: "mcp_call";
|
|
249
|
+
id: string;
|
|
250
|
+
status: string;
|
|
251
|
+
approval_request_id?: string | null | undefined;
|
|
252
|
+
} | {
|
|
253
|
+
type: "mcp_list_tools";
|
|
254
|
+
id: string;
|
|
255
|
+
} | {
|
|
256
|
+
type: "mcp_approval_request";
|
|
257
|
+
id: string;
|
|
258
|
+
} | {
|
|
259
|
+
type: "apply_patch_call";
|
|
260
|
+
id: string;
|
|
261
|
+
call_id: string;
|
|
262
|
+
status: "completed" | "in_progress";
|
|
263
|
+
operation: {
|
|
264
|
+
type: "create_file";
|
|
265
|
+
path: string;
|
|
266
|
+
diff: string;
|
|
267
|
+
} | {
|
|
268
|
+
type: "delete_file";
|
|
269
|
+
path: string;
|
|
270
|
+
} | {
|
|
271
|
+
type: "update_file";
|
|
272
|
+
path: string;
|
|
273
|
+
diff: string;
|
|
274
|
+
};
|
|
275
|
+
} | {
|
|
276
|
+
type: "shell_call";
|
|
277
|
+
id: string;
|
|
278
|
+
call_id: string;
|
|
279
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
280
|
+
action: {
|
|
281
|
+
commands: string[];
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
} | {
|
|
285
|
+
type: "response.output_item.done";
|
|
286
|
+
output_index: number;
|
|
287
|
+
item: {
|
|
288
|
+
type: "message";
|
|
289
|
+
id: string;
|
|
290
|
+
} | {
|
|
291
|
+
type: "reasoning";
|
|
292
|
+
id: string;
|
|
293
|
+
encrypted_content?: string | null | undefined;
|
|
294
|
+
} | {
|
|
295
|
+
type: "function_call";
|
|
296
|
+
id: string;
|
|
297
|
+
call_id: string;
|
|
298
|
+
name: string;
|
|
299
|
+
arguments: string;
|
|
300
|
+
status: "completed";
|
|
301
|
+
} | {
|
|
302
|
+
type: "code_interpreter_call";
|
|
303
|
+
id: string;
|
|
304
|
+
code: string | null;
|
|
305
|
+
container_id: string;
|
|
306
|
+
outputs: ({
|
|
307
|
+
type: "logs";
|
|
308
|
+
logs: string;
|
|
309
|
+
} | {
|
|
310
|
+
type: "image";
|
|
311
|
+
url: string;
|
|
312
|
+
})[] | null;
|
|
313
|
+
} | {
|
|
314
|
+
type: "image_generation_call";
|
|
315
|
+
id: string;
|
|
316
|
+
result: string;
|
|
317
|
+
} | {
|
|
318
|
+
type: "web_search_call";
|
|
319
|
+
id: string;
|
|
320
|
+
status: string;
|
|
321
|
+
action: {
|
|
322
|
+
type: "search";
|
|
323
|
+
query?: string | null | undefined;
|
|
324
|
+
sources?: ({
|
|
325
|
+
type: "url";
|
|
326
|
+
url: string;
|
|
327
|
+
} | {
|
|
328
|
+
type: "api";
|
|
329
|
+
name: string;
|
|
330
|
+
})[] | null | undefined;
|
|
331
|
+
} | {
|
|
332
|
+
type: "open_page";
|
|
333
|
+
url?: string | null | undefined;
|
|
334
|
+
} | {
|
|
335
|
+
type: "find_in_page";
|
|
336
|
+
url?: string | null | undefined;
|
|
337
|
+
pattern?: string | null | undefined;
|
|
338
|
+
};
|
|
339
|
+
} | {
|
|
340
|
+
type: "file_search_call";
|
|
341
|
+
id: string;
|
|
342
|
+
queries: string[];
|
|
343
|
+
results?: {
|
|
344
|
+
attributes: Record<string, string | number | boolean>;
|
|
345
|
+
file_id: string;
|
|
346
|
+
filename: string;
|
|
347
|
+
score: number;
|
|
348
|
+
text: string;
|
|
349
|
+
}[] | null | undefined;
|
|
350
|
+
} | {
|
|
351
|
+
type: "local_shell_call";
|
|
352
|
+
id: string;
|
|
353
|
+
call_id: string;
|
|
354
|
+
action: {
|
|
355
|
+
type: "exec";
|
|
356
|
+
command: string[];
|
|
357
|
+
timeout_ms?: number | undefined;
|
|
358
|
+
user?: string | undefined;
|
|
359
|
+
working_directory?: string | undefined;
|
|
360
|
+
env?: Record<string, string> | undefined;
|
|
361
|
+
};
|
|
362
|
+
} | {
|
|
363
|
+
type: "computer_call";
|
|
364
|
+
id: string;
|
|
365
|
+
status: "completed";
|
|
366
|
+
} | {
|
|
367
|
+
type: "mcp_call";
|
|
368
|
+
id: string;
|
|
369
|
+
status: string;
|
|
370
|
+
arguments: string;
|
|
371
|
+
name: string;
|
|
372
|
+
server_label: string;
|
|
373
|
+
output?: string | null | undefined;
|
|
374
|
+
error?: string | {
|
|
375
|
+
[x: string]: unknown;
|
|
376
|
+
type?: string | undefined;
|
|
377
|
+
code?: string | number | undefined;
|
|
378
|
+
message?: string | undefined;
|
|
379
|
+
} | null | undefined;
|
|
380
|
+
approval_request_id?: string | null | undefined;
|
|
381
|
+
} | {
|
|
382
|
+
type: "mcp_list_tools";
|
|
383
|
+
id: string;
|
|
384
|
+
server_label: string;
|
|
385
|
+
tools: {
|
|
386
|
+
name: string;
|
|
387
|
+
input_schema: any;
|
|
388
|
+
description?: string | undefined;
|
|
389
|
+
annotations?: Record<string, unknown> | undefined;
|
|
390
|
+
}[];
|
|
391
|
+
error?: string | {
|
|
392
|
+
[x: string]: unknown;
|
|
393
|
+
type?: string | undefined;
|
|
394
|
+
code?: string | number | undefined;
|
|
395
|
+
message?: string | undefined;
|
|
396
|
+
} | undefined;
|
|
397
|
+
} | {
|
|
398
|
+
type: "mcp_approval_request";
|
|
399
|
+
id: string;
|
|
400
|
+
server_label: string;
|
|
401
|
+
name: string;
|
|
402
|
+
arguments: string;
|
|
403
|
+
approval_request_id?: string | undefined;
|
|
404
|
+
} | {
|
|
405
|
+
type: "apply_patch_call";
|
|
406
|
+
id: string;
|
|
407
|
+
call_id: string;
|
|
408
|
+
status: "completed" | "in_progress";
|
|
409
|
+
operation: {
|
|
410
|
+
type: "create_file";
|
|
411
|
+
path: string;
|
|
412
|
+
diff: string;
|
|
413
|
+
} | {
|
|
414
|
+
type: "delete_file";
|
|
415
|
+
path: string;
|
|
416
|
+
} | {
|
|
417
|
+
type: "update_file";
|
|
418
|
+
path: string;
|
|
419
|
+
diff: string;
|
|
420
|
+
};
|
|
421
|
+
} | {
|
|
422
|
+
type: "shell_call";
|
|
423
|
+
id: string;
|
|
424
|
+
call_id: string;
|
|
425
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
426
|
+
action: {
|
|
427
|
+
commands: string[];
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
} | {
|
|
431
|
+
type: "response.function_call_arguments.delta";
|
|
432
|
+
item_id: string;
|
|
433
|
+
output_index: number;
|
|
434
|
+
delta: string;
|
|
435
|
+
} | {
|
|
436
|
+
type: "response.image_generation_call.partial_image";
|
|
437
|
+
item_id: string;
|
|
438
|
+
output_index: number;
|
|
439
|
+
partial_image_b64: string;
|
|
440
|
+
} | {
|
|
441
|
+
type: "response.code_interpreter_call_code.delta";
|
|
442
|
+
item_id: string;
|
|
443
|
+
output_index: number;
|
|
444
|
+
delta: string;
|
|
445
|
+
} | {
|
|
446
|
+
type: "response.code_interpreter_call_code.done";
|
|
447
|
+
item_id: string;
|
|
448
|
+
output_index: number;
|
|
449
|
+
code: string;
|
|
450
|
+
} | {
|
|
451
|
+
type: "response.output_text.annotation.added";
|
|
452
|
+
annotation: {
|
|
453
|
+
type: "url_citation";
|
|
454
|
+
start_index: number;
|
|
455
|
+
end_index: number;
|
|
456
|
+
url: string;
|
|
457
|
+
title: string;
|
|
458
|
+
} | {
|
|
459
|
+
type: "file_citation";
|
|
460
|
+
file_id: string;
|
|
461
|
+
filename: string;
|
|
462
|
+
index: number;
|
|
463
|
+
} | {
|
|
464
|
+
type: "container_file_citation";
|
|
465
|
+
container_id: string;
|
|
466
|
+
file_id: string;
|
|
467
|
+
filename: string;
|
|
468
|
+
start_index: number;
|
|
469
|
+
end_index: number;
|
|
470
|
+
} | {
|
|
471
|
+
type: "file_path";
|
|
472
|
+
file_id: string;
|
|
473
|
+
index: number;
|
|
474
|
+
};
|
|
475
|
+
} | {
|
|
476
|
+
type: "response.reasoning_summary_part.added";
|
|
477
|
+
item_id: string;
|
|
478
|
+
summary_index: number;
|
|
479
|
+
} | {
|
|
480
|
+
type: "response.reasoning_summary_text.delta";
|
|
481
|
+
item_id: string;
|
|
482
|
+
summary_index: number;
|
|
483
|
+
delta: string;
|
|
484
|
+
} | {
|
|
485
|
+
type: "response.reasoning_summary_part.done";
|
|
486
|
+
item_id: string;
|
|
487
|
+
summary_index: number;
|
|
488
|
+
} | {
|
|
489
|
+
type: "response.apply_patch_call_operation_diff.delta";
|
|
490
|
+
item_id: string;
|
|
491
|
+
output_index: number;
|
|
492
|
+
delta: string;
|
|
493
|
+
obfuscation?: string | null | undefined;
|
|
494
|
+
} | {
|
|
495
|
+
type: "response.apply_patch_call_operation_diff.done";
|
|
496
|
+
item_id: string;
|
|
497
|
+
output_index: number;
|
|
498
|
+
diff: string;
|
|
499
|
+
} | {
|
|
500
|
+
type: "error";
|
|
501
|
+
sequence_number: number;
|
|
502
|
+
error: {
|
|
503
|
+
type: string;
|
|
504
|
+
code: string;
|
|
505
|
+
message: string;
|
|
506
|
+
param?: string | null | undefined;
|
|
507
|
+
};
|
|
508
|
+
}>;
|
|
163
509
|
|
|
164
510
|
/**
|
|
165
511
|
* Type definitions for the apply_patch operations.
|
|
@@ -559,6 +905,34 @@ Default OpenAI provider instance.
|
|
|
559
905
|
*/
|
|
560
906
|
declare const openai: OpenAIProvider;
|
|
561
907
|
|
|
908
|
+
type OpenaiResponsesChunk = InferSchema<typeof openaiResponsesChunkSchema>;
|
|
909
|
+
type ResponsesOutputTextAnnotationProviderMetadata = Extract<OpenaiResponsesChunk, {
|
|
910
|
+
type: 'response.output_text.annotation.added';
|
|
911
|
+
}>['annotation'];
|
|
912
|
+
type ResponsesTextProviderMetadata = {
|
|
913
|
+
itemId: string;
|
|
914
|
+
annotations?: Array<ResponsesOutputTextAnnotationProviderMetadata>;
|
|
915
|
+
};
|
|
916
|
+
type OpenaiResponsesTextProviderMetadata = {
|
|
917
|
+
openai: ResponsesTextProviderMetadata;
|
|
918
|
+
};
|
|
919
|
+
type ResponsesSourceDocumentProviderMetadata = {
|
|
920
|
+
type: 'file_citation';
|
|
921
|
+
fileId: string;
|
|
922
|
+
index: number;
|
|
923
|
+
} | {
|
|
924
|
+
type: 'container_file_citation';
|
|
925
|
+
fileId: string;
|
|
926
|
+
containerId: string;
|
|
927
|
+
} | {
|
|
928
|
+
type: 'file_path';
|
|
929
|
+
fileId: string;
|
|
930
|
+
index: number;
|
|
931
|
+
};
|
|
932
|
+
type OpenaiResponsesSourceDocumentProviderMetadata = {
|
|
933
|
+
openai: ResponsesSourceDocumentProviderMetadata;
|
|
934
|
+
};
|
|
935
|
+
|
|
562
936
|
declare const VERSION: string;
|
|
563
937
|
|
|
564
|
-
export { type OpenAIChatLanguageModelOptions, type OpenAIProvider, type OpenAIProviderSettings, type OpenAIResponsesProviderOptions, VERSION, createOpenAI, openai };
|
|
938
|
+
export { type OpenAIChatLanguageModelOptions, type OpenAIProvider, type OpenAIProviderSettings, type OpenAIResponsesProviderOptions, type OpenaiResponsesSourceDocumentProviderMetadata, type OpenaiResponsesTextProviderMetadata, VERSION, createOpenAI, openai };
|