@ai-sdk/openai 3.0.29 → 3.0.31
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 +12 -0
- package/dist/index.d.mts +77 -6
- package/dist/index.d.ts +77 -6
- package/dist/index.js +261 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +261 -12
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +33 -3
- package/dist/internal/index.d.ts +33 -3
- package/dist/internal/index.js +260 -11
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +260 -11
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +220 -46
- package/package.json +3 -3
- package/src/responses/convert-to-openai-responses-input.ts +40 -7
- package/src/responses/openai-responses-api.ts +159 -47
- package/src/responses/openai-responses-language-model.ts +74 -2
- package/src/responses/openai-responses-prepare-tools.ts +114 -0
- package/src/tool/shell.ts +119 -1
- package/src/tool/web-search-preview.ts +18 -16
- package/src/tool/web-search.ts +18 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 3.0.31
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d5f7312: fix(openai): change web search tool action to be optional
|
|
8
|
+
|
|
9
|
+
## 3.0.30
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- ff12133: feat(provider/openai): support native skills and hosted shell
|
|
14
|
+
|
|
3
15
|
## 3.0.29
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -49,7 +49,7 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
|
|
|
49
49
|
* An object describing the specific action taken in this web search call.
|
|
50
50
|
* Includes details on how the model used the web (search, open_page, find_in_page).
|
|
51
51
|
*/
|
|
52
|
-
action
|
|
52
|
+
action?: {
|
|
53
53
|
/**
|
|
54
54
|
* Action type "search" - Performs a web search query.
|
|
55
55
|
*/
|
|
@@ -293,6 +293,21 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
293
293
|
action: {
|
|
294
294
|
commands: string[];
|
|
295
295
|
};
|
|
296
|
+
} | {
|
|
297
|
+
type: "shell_call_output";
|
|
298
|
+
id: string;
|
|
299
|
+
call_id: string;
|
|
300
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
301
|
+
output: {
|
|
302
|
+
stdout: string;
|
|
303
|
+
stderr: string;
|
|
304
|
+
outcome: {
|
|
305
|
+
type: "timeout";
|
|
306
|
+
} | {
|
|
307
|
+
type: "exit";
|
|
308
|
+
exit_code: number;
|
|
309
|
+
};
|
|
310
|
+
}[];
|
|
296
311
|
};
|
|
297
312
|
} | {
|
|
298
313
|
type: "response.output_item.done";
|
|
@@ -331,7 +346,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
331
346
|
type: "web_search_call";
|
|
332
347
|
id: string;
|
|
333
348
|
status: string;
|
|
334
|
-
action
|
|
349
|
+
action?: {
|
|
335
350
|
type: "search";
|
|
336
351
|
query?: string | null | undefined;
|
|
337
352
|
sources?: ({
|
|
@@ -348,7 +363,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
348
363
|
type: "find_in_page";
|
|
349
364
|
url?: string | null | undefined;
|
|
350
365
|
pattern?: string | null | undefined;
|
|
351
|
-
};
|
|
366
|
+
} | null | undefined;
|
|
352
367
|
} | {
|
|
353
368
|
type: "file_search_call";
|
|
354
369
|
id: string;
|
|
@@ -439,6 +454,21 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
439
454
|
action: {
|
|
440
455
|
commands: string[];
|
|
441
456
|
};
|
|
457
|
+
} | {
|
|
458
|
+
type: "shell_call_output";
|
|
459
|
+
id: string;
|
|
460
|
+
call_id: string;
|
|
461
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
462
|
+
output: {
|
|
463
|
+
stdout: string;
|
|
464
|
+
stderr: string;
|
|
465
|
+
outcome: {
|
|
466
|
+
type: "timeout";
|
|
467
|
+
} | {
|
|
468
|
+
type: "exit";
|
|
469
|
+
exit_code: number;
|
|
470
|
+
};
|
|
471
|
+
}[];
|
|
442
472
|
};
|
|
443
473
|
} | {
|
|
444
474
|
type: "response.function_call_arguments.delta";
|
|
@@ -700,7 +730,48 @@ declare const openaiTools: {
|
|
|
700
730
|
exitCode: number;
|
|
701
731
|
};
|
|
702
732
|
}>;
|
|
703
|
-
}, {
|
|
733
|
+
}, {
|
|
734
|
+
environment?: {
|
|
735
|
+
type: "containerAuto";
|
|
736
|
+
fileIds?: string[];
|
|
737
|
+
memoryLimit?: "1g" | "4g" | "16g" | "64g";
|
|
738
|
+
networkPolicy?: {
|
|
739
|
+
type: "disabled";
|
|
740
|
+
} | {
|
|
741
|
+
type: "allowlist";
|
|
742
|
+
allowedDomains: string[];
|
|
743
|
+
domainSecrets?: Array<{
|
|
744
|
+
domain: string;
|
|
745
|
+
name: string;
|
|
746
|
+
value: string;
|
|
747
|
+
}>;
|
|
748
|
+
};
|
|
749
|
+
skills?: Array<{
|
|
750
|
+
type: "skillReference";
|
|
751
|
+
skillId: string;
|
|
752
|
+
version?: string;
|
|
753
|
+
} | {
|
|
754
|
+
type: "inline";
|
|
755
|
+
name: string;
|
|
756
|
+
description: string;
|
|
757
|
+
source: {
|
|
758
|
+
type: "base64";
|
|
759
|
+
mediaType: "application/zip";
|
|
760
|
+
data: string;
|
|
761
|
+
};
|
|
762
|
+
}>;
|
|
763
|
+
} | {
|
|
764
|
+
type: "containerReference";
|
|
765
|
+
containerId: string;
|
|
766
|
+
} | {
|
|
767
|
+
type?: "local";
|
|
768
|
+
skills?: Array<{
|
|
769
|
+
name: string;
|
|
770
|
+
description: string;
|
|
771
|
+
path: string;
|
|
772
|
+
}>;
|
|
773
|
+
};
|
|
774
|
+
}>;
|
|
704
775
|
/**
|
|
705
776
|
* Web search allows models to access up-to-date information from the internet
|
|
706
777
|
* and provide answers with sourced citations.
|
|
@@ -709,7 +780,7 @@ declare const openaiTools: {
|
|
|
709
780
|
* @param userLocation - The user location to use for the web search.
|
|
710
781
|
*/
|
|
711
782
|
webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
712
|
-
action
|
|
783
|
+
action?: {
|
|
713
784
|
type: "search";
|
|
714
785
|
query?: string;
|
|
715
786
|
} | {
|
|
@@ -739,7 +810,7 @@ declare const openaiTools: {
|
|
|
739
810
|
* @param userLocation - The user location to use for the web search.
|
|
740
811
|
*/
|
|
741
812
|
webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
742
|
-
action
|
|
813
|
+
action?: {
|
|
743
814
|
type: "search";
|
|
744
815
|
query?: string;
|
|
745
816
|
} | {
|
package/dist/index.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
|
|
|
49
49
|
* An object describing the specific action taken in this web search call.
|
|
50
50
|
* Includes details on how the model used the web (search, open_page, find_in_page).
|
|
51
51
|
*/
|
|
52
|
-
action
|
|
52
|
+
action?: {
|
|
53
53
|
/**
|
|
54
54
|
* Action type "search" - Performs a web search query.
|
|
55
55
|
*/
|
|
@@ -293,6 +293,21 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
293
293
|
action: {
|
|
294
294
|
commands: string[];
|
|
295
295
|
};
|
|
296
|
+
} | {
|
|
297
|
+
type: "shell_call_output";
|
|
298
|
+
id: string;
|
|
299
|
+
call_id: string;
|
|
300
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
301
|
+
output: {
|
|
302
|
+
stdout: string;
|
|
303
|
+
stderr: string;
|
|
304
|
+
outcome: {
|
|
305
|
+
type: "timeout";
|
|
306
|
+
} | {
|
|
307
|
+
type: "exit";
|
|
308
|
+
exit_code: number;
|
|
309
|
+
};
|
|
310
|
+
}[];
|
|
296
311
|
};
|
|
297
312
|
} | {
|
|
298
313
|
type: "response.output_item.done";
|
|
@@ -331,7 +346,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
331
346
|
type: "web_search_call";
|
|
332
347
|
id: string;
|
|
333
348
|
status: string;
|
|
334
|
-
action
|
|
349
|
+
action?: {
|
|
335
350
|
type: "search";
|
|
336
351
|
query?: string | null | undefined;
|
|
337
352
|
sources?: ({
|
|
@@ -348,7 +363,7 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
348
363
|
type: "find_in_page";
|
|
349
364
|
url?: string | null | undefined;
|
|
350
365
|
pattern?: string | null | undefined;
|
|
351
|
-
};
|
|
366
|
+
} | null | undefined;
|
|
352
367
|
} | {
|
|
353
368
|
type: "file_search_call";
|
|
354
369
|
id: string;
|
|
@@ -439,6 +454,21 @@ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
439
454
|
action: {
|
|
440
455
|
commands: string[];
|
|
441
456
|
};
|
|
457
|
+
} | {
|
|
458
|
+
type: "shell_call_output";
|
|
459
|
+
id: string;
|
|
460
|
+
call_id: string;
|
|
461
|
+
status: "completed" | "in_progress" | "incomplete";
|
|
462
|
+
output: {
|
|
463
|
+
stdout: string;
|
|
464
|
+
stderr: string;
|
|
465
|
+
outcome: {
|
|
466
|
+
type: "timeout";
|
|
467
|
+
} | {
|
|
468
|
+
type: "exit";
|
|
469
|
+
exit_code: number;
|
|
470
|
+
};
|
|
471
|
+
}[];
|
|
442
472
|
};
|
|
443
473
|
} | {
|
|
444
474
|
type: "response.function_call_arguments.delta";
|
|
@@ -700,7 +730,48 @@ declare const openaiTools: {
|
|
|
700
730
|
exitCode: number;
|
|
701
731
|
};
|
|
702
732
|
}>;
|
|
703
|
-
}, {
|
|
733
|
+
}, {
|
|
734
|
+
environment?: {
|
|
735
|
+
type: "containerAuto";
|
|
736
|
+
fileIds?: string[];
|
|
737
|
+
memoryLimit?: "1g" | "4g" | "16g" | "64g";
|
|
738
|
+
networkPolicy?: {
|
|
739
|
+
type: "disabled";
|
|
740
|
+
} | {
|
|
741
|
+
type: "allowlist";
|
|
742
|
+
allowedDomains: string[];
|
|
743
|
+
domainSecrets?: Array<{
|
|
744
|
+
domain: string;
|
|
745
|
+
name: string;
|
|
746
|
+
value: string;
|
|
747
|
+
}>;
|
|
748
|
+
};
|
|
749
|
+
skills?: Array<{
|
|
750
|
+
type: "skillReference";
|
|
751
|
+
skillId: string;
|
|
752
|
+
version?: string;
|
|
753
|
+
} | {
|
|
754
|
+
type: "inline";
|
|
755
|
+
name: string;
|
|
756
|
+
description: string;
|
|
757
|
+
source: {
|
|
758
|
+
type: "base64";
|
|
759
|
+
mediaType: "application/zip";
|
|
760
|
+
data: string;
|
|
761
|
+
};
|
|
762
|
+
}>;
|
|
763
|
+
} | {
|
|
764
|
+
type: "containerReference";
|
|
765
|
+
containerId: string;
|
|
766
|
+
} | {
|
|
767
|
+
type?: "local";
|
|
768
|
+
skills?: Array<{
|
|
769
|
+
name: string;
|
|
770
|
+
description: string;
|
|
771
|
+
path: string;
|
|
772
|
+
}>;
|
|
773
|
+
};
|
|
774
|
+
}>;
|
|
704
775
|
/**
|
|
705
776
|
* Web search allows models to access up-to-date information from the internet
|
|
706
777
|
* and provide answers with sourced citations.
|
|
@@ -709,7 +780,7 @@ declare const openaiTools: {
|
|
|
709
780
|
* @param userLocation - The user location to use for the web search.
|
|
710
781
|
*/
|
|
711
782
|
webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
712
|
-
action
|
|
783
|
+
action?: {
|
|
713
784
|
type: "search";
|
|
714
785
|
query?: string;
|
|
715
786
|
} | {
|
|
@@ -739,7 +810,7 @@ declare const openaiTools: {
|
|
|
739
810
|
* @param userLocation - The user location to use for the web search.
|
|
740
811
|
*/
|
|
741
812
|
webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
742
|
-
action
|
|
813
|
+
action?: {
|
|
743
814
|
type: "search";
|
|
744
815
|
query?: string;
|
|
745
816
|
} | {
|