@ai-sdk/openai 4.0.13 → 4.0.15
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 +13 -0
- package/dist/index.d.ts +285 -24
- package/dist/index.js +1496 -1152
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +184 -8
- package/dist/internal/index.js +1438 -1104
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +89 -0
- package/package.json +4 -4
- package/src/index.ts +4 -0
- package/src/openai-tools.ts +11 -0
- package/src/responses/convert-to-openai-responses-input.ts +83 -1
- package/src/responses/openai-responses-api.ts +96 -19
- package/src/responses/openai-responses-language-model.ts +162 -31
- package/src/responses/openai-responses-prepare-tools.ts +9 -1
- package/src/tool/computer.ts +147 -0
package/dist/internal/index.d.ts
CHANGED
|
@@ -428,6 +428,98 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
428
428
|
type: "response.output_item.added";
|
|
429
429
|
output_index: number;
|
|
430
430
|
item: {
|
|
431
|
+
type: "computer_call";
|
|
432
|
+
id: string;
|
|
433
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
434
|
+
call_id?: string | null | undefined;
|
|
435
|
+
action?: {
|
|
436
|
+
type: "click";
|
|
437
|
+
button: "left" | "right" | "wheel" | "back" | "forward";
|
|
438
|
+
x: number;
|
|
439
|
+
y: number;
|
|
440
|
+
keys?: string[] | null | undefined;
|
|
441
|
+
} | {
|
|
442
|
+
type: "double_click";
|
|
443
|
+
x: number;
|
|
444
|
+
y: number;
|
|
445
|
+
keys?: string[] | null | undefined;
|
|
446
|
+
} | {
|
|
447
|
+
type: "drag";
|
|
448
|
+
path: {
|
|
449
|
+
x: number;
|
|
450
|
+
y: number;
|
|
451
|
+
}[];
|
|
452
|
+
keys?: string[] | null | undefined;
|
|
453
|
+
} | {
|
|
454
|
+
type: "keypress";
|
|
455
|
+
keys: string[];
|
|
456
|
+
} | {
|
|
457
|
+
type: "move";
|
|
458
|
+
x: number;
|
|
459
|
+
y: number;
|
|
460
|
+
keys?: string[] | null | undefined;
|
|
461
|
+
} | {
|
|
462
|
+
type: "screenshot";
|
|
463
|
+
} | {
|
|
464
|
+
type: "scroll";
|
|
465
|
+
x: number;
|
|
466
|
+
y: number;
|
|
467
|
+
scroll_x: number;
|
|
468
|
+
scroll_y: number;
|
|
469
|
+
keys?: string[] | null | undefined;
|
|
470
|
+
} | {
|
|
471
|
+
type: "type";
|
|
472
|
+
text: string;
|
|
473
|
+
} | {
|
|
474
|
+
type: "wait";
|
|
475
|
+
} | null | undefined;
|
|
476
|
+
actions?: ({
|
|
477
|
+
type: "click";
|
|
478
|
+
button: "left" | "right" | "wheel" | "back" | "forward";
|
|
479
|
+
x: number;
|
|
480
|
+
y: number;
|
|
481
|
+
keys?: string[] | null | undefined;
|
|
482
|
+
} | {
|
|
483
|
+
type: "double_click";
|
|
484
|
+
x: number;
|
|
485
|
+
y: number;
|
|
486
|
+
keys?: string[] | null | undefined;
|
|
487
|
+
} | {
|
|
488
|
+
type: "drag";
|
|
489
|
+
path: {
|
|
490
|
+
x: number;
|
|
491
|
+
y: number;
|
|
492
|
+
}[];
|
|
493
|
+
keys?: string[] | null | undefined;
|
|
494
|
+
} | {
|
|
495
|
+
type: "keypress";
|
|
496
|
+
keys: string[];
|
|
497
|
+
} | {
|
|
498
|
+
type: "move";
|
|
499
|
+
x: number;
|
|
500
|
+
y: number;
|
|
501
|
+
keys?: string[] | null | undefined;
|
|
502
|
+
} | {
|
|
503
|
+
type: "screenshot";
|
|
504
|
+
} | {
|
|
505
|
+
type: "scroll";
|
|
506
|
+
x: number;
|
|
507
|
+
y: number;
|
|
508
|
+
scroll_x: number;
|
|
509
|
+
scroll_y: number;
|
|
510
|
+
keys?: string[] | null | undefined;
|
|
511
|
+
} | {
|
|
512
|
+
type: "type";
|
|
513
|
+
text: string;
|
|
514
|
+
} | {
|
|
515
|
+
type: "wait";
|
|
516
|
+
})[] | null | undefined;
|
|
517
|
+
pending_safety_checks?: {
|
|
518
|
+
id: string;
|
|
519
|
+
code?: string | null | undefined;
|
|
520
|
+
message?: string | null | undefined;
|
|
521
|
+
}[] | null | undefined;
|
|
522
|
+
} | {
|
|
431
523
|
type: "message";
|
|
432
524
|
id: string;
|
|
433
525
|
phase?: "commentary" | "final_answer" | null | undefined;
|
|
@@ -446,10 +538,6 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
446
538
|
type: "web_search_call";
|
|
447
539
|
id: string;
|
|
448
540
|
status: string;
|
|
449
|
-
} | {
|
|
450
|
-
type: "computer_call";
|
|
451
|
-
id: string;
|
|
452
|
-
status: string;
|
|
453
541
|
} | {
|
|
454
542
|
type: "file_search_call";
|
|
455
543
|
id: string;
|
|
@@ -549,6 +637,98 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
549
637
|
type: "response.output_item.done";
|
|
550
638
|
output_index: number;
|
|
551
639
|
item: {
|
|
640
|
+
type: "computer_call";
|
|
641
|
+
id: string;
|
|
642
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
643
|
+
call_id?: string | null | undefined;
|
|
644
|
+
action?: {
|
|
645
|
+
type: "click";
|
|
646
|
+
button: "left" | "right" | "wheel" | "back" | "forward";
|
|
647
|
+
x: number;
|
|
648
|
+
y: number;
|
|
649
|
+
keys?: string[] | null | undefined;
|
|
650
|
+
} | {
|
|
651
|
+
type: "double_click";
|
|
652
|
+
x: number;
|
|
653
|
+
y: number;
|
|
654
|
+
keys?: string[] | null | undefined;
|
|
655
|
+
} | {
|
|
656
|
+
type: "drag";
|
|
657
|
+
path: {
|
|
658
|
+
x: number;
|
|
659
|
+
y: number;
|
|
660
|
+
}[];
|
|
661
|
+
keys?: string[] | null | undefined;
|
|
662
|
+
} | {
|
|
663
|
+
type: "keypress";
|
|
664
|
+
keys: string[];
|
|
665
|
+
} | {
|
|
666
|
+
type: "move";
|
|
667
|
+
x: number;
|
|
668
|
+
y: number;
|
|
669
|
+
keys?: string[] | null | undefined;
|
|
670
|
+
} | {
|
|
671
|
+
type: "screenshot";
|
|
672
|
+
} | {
|
|
673
|
+
type: "scroll";
|
|
674
|
+
x: number;
|
|
675
|
+
y: number;
|
|
676
|
+
scroll_x: number;
|
|
677
|
+
scroll_y: number;
|
|
678
|
+
keys?: string[] | null | undefined;
|
|
679
|
+
} | {
|
|
680
|
+
type: "type";
|
|
681
|
+
text: string;
|
|
682
|
+
} | {
|
|
683
|
+
type: "wait";
|
|
684
|
+
} | null | undefined;
|
|
685
|
+
actions?: ({
|
|
686
|
+
type: "click";
|
|
687
|
+
button: "left" | "right" | "wheel" | "back" | "forward";
|
|
688
|
+
x: number;
|
|
689
|
+
y: number;
|
|
690
|
+
keys?: string[] | null | undefined;
|
|
691
|
+
} | {
|
|
692
|
+
type: "double_click";
|
|
693
|
+
x: number;
|
|
694
|
+
y: number;
|
|
695
|
+
keys?: string[] | null | undefined;
|
|
696
|
+
} | {
|
|
697
|
+
type: "drag";
|
|
698
|
+
path: {
|
|
699
|
+
x: number;
|
|
700
|
+
y: number;
|
|
701
|
+
}[];
|
|
702
|
+
keys?: string[] | null | undefined;
|
|
703
|
+
} | {
|
|
704
|
+
type: "keypress";
|
|
705
|
+
keys: string[];
|
|
706
|
+
} | {
|
|
707
|
+
type: "move";
|
|
708
|
+
x: number;
|
|
709
|
+
y: number;
|
|
710
|
+
keys?: string[] | null | undefined;
|
|
711
|
+
} | {
|
|
712
|
+
type: "screenshot";
|
|
713
|
+
} | {
|
|
714
|
+
type: "scroll";
|
|
715
|
+
x: number;
|
|
716
|
+
y: number;
|
|
717
|
+
scroll_x: number;
|
|
718
|
+
scroll_y: number;
|
|
719
|
+
keys?: string[] | null | undefined;
|
|
720
|
+
} | {
|
|
721
|
+
type: "type";
|
|
722
|
+
text: string;
|
|
723
|
+
} | {
|
|
724
|
+
type: "wait";
|
|
725
|
+
})[] | null | undefined;
|
|
726
|
+
pending_safety_checks?: {
|
|
727
|
+
id: string;
|
|
728
|
+
code?: string | null | undefined;
|
|
729
|
+
message?: string | null | undefined;
|
|
730
|
+
}[] | null | undefined;
|
|
731
|
+
} | {
|
|
552
732
|
type: "message";
|
|
553
733
|
id: string;
|
|
554
734
|
phase?: "commentary" | "final_answer" | null | undefined;
|
|
@@ -633,10 +813,6 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
633
813
|
working_directory?: string | undefined;
|
|
634
814
|
env?: Record<string, string> | undefined;
|
|
635
815
|
};
|
|
636
|
-
} | {
|
|
637
|
-
type: "computer_call";
|
|
638
|
-
id: string;
|
|
639
|
-
status: "completed";
|
|
640
816
|
} | {
|
|
641
817
|
type: "mcp_call";
|
|
642
818
|
id: string;
|