@ai-sdk/openai 4.0.0-beta.17 → 4.0.0-beta.19
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 +15 -0
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/internal/index.d.mts +7 -7
- package/dist/internal/index.d.ts +7 -7
- package/docs/03-openai.mdx +10 -10
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 4.0.0-beta.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [2e17091]
|
|
8
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
9
|
+
|
|
10
|
+
## 4.0.0-beta.18
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [986c6fd]
|
|
15
|
+
- Updated dependencies [493295c]
|
|
16
|
+
- @ai-sdk/provider-utils@5.0.0-beta.8
|
|
17
|
+
|
|
3
18
|
## 4.0.0-beta.17
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -141,7 +141,7 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
|
|
|
141
141
|
*/
|
|
142
142
|
timezone?: string;
|
|
143
143
|
};
|
|
144
|
-
}>;
|
|
144
|
+
}, {}>;
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
147
|
* A filter used to compare a specified attribute key to a given value using a defined comparison operation.
|
|
@@ -648,7 +648,7 @@ declare const customToolFactory: _ai_sdk_provider_utils.ProviderToolFactory<stri
|
|
|
648
648
|
} | {
|
|
649
649
|
type: "text";
|
|
650
650
|
};
|
|
651
|
-
}>;
|
|
651
|
+
}, {}>;
|
|
652
652
|
|
|
653
653
|
/**
|
|
654
654
|
* Type definitions for the apply_patch operations.
|
|
@@ -695,7 +695,7 @@ declare const openaiTools: {
|
|
|
695
695
|
}, {
|
|
696
696
|
status: "completed" | "failed";
|
|
697
697
|
output?: string;
|
|
698
|
-
}, {}>;
|
|
698
|
+
}, {}, {}>;
|
|
699
699
|
/**
|
|
700
700
|
* Custom tools let callers constrain model output to a grammar (regex or
|
|
701
701
|
* Lark syntax). The model returns a `custom_tool_call` output item whose
|
|
@@ -704,7 +704,7 @@ declare const openaiTools: {
|
|
|
704
704
|
* @param description - An optional description of the tool.
|
|
705
705
|
* @param format - The output format constraint (grammar type, syntax, and definition).
|
|
706
706
|
*/
|
|
707
|
-
customTool: (args: Parameters<typeof customToolFactory>[0]) => _ai_sdk_provider_utils.Tool<string, unknown>;
|
|
707
|
+
customTool: (args: Parameters<typeof customToolFactory>[0]) => _ai_sdk_provider_utils.Tool<string, unknown, {}>;
|
|
708
708
|
/**
|
|
709
709
|
* The Code Interpreter tool allows models to write and run Python code in a
|
|
710
710
|
* sandboxed environment to solve complex problems in domains like data analysis,
|
|
@@ -727,7 +727,7 @@ declare const openaiTools: {
|
|
|
727
727
|
type: "image";
|
|
728
728
|
url: string;
|
|
729
729
|
}> | null;
|
|
730
|
-
}>;
|
|
730
|
+
}, {}>;
|
|
731
731
|
/**
|
|
732
732
|
* File search is a tool available in the Responses API. It enables models to
|
|
733
733
|
* retrieve information in a knowledge base of previously uploaded files through
|
|
@@ -755,7 +755,7 @@ declare const openaiTools: {
|
|
|
755
755
|
scoreThreshold?: number;
|
|
756
756
|
};
|
|
757
757
|
filters?: OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter;
|
|
758
|
-
}>;
|
|
758
|
+
}, {}>;
|
|
759
759
|
/**
|
|
760
760
|
* The image generation tool allows you to generate images using a text prompt,
|
|
761
761
|
* and optionally image inputs. It leverages the GPT Image model,
|
|
@@ -788,7 +788,7 @@ declare const openaiTools: {
|
|
|
788
788
|
size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024";
|
|
789
789
|
}) => _ai_sdk_provider_utils.Tool<{}, {
|
|
790
790
|
result: string;
|
|
791
|
-
}>;
|
|
791
|
+
}, {}>;
|
|
792
792
|
/**
|
|
793
793
|
* Local shell is a tool that allows agents to run shell commands locally
|
|
794
794
|
* on a machine you or the user provides.
|
|
@@ -806,7 +806,7 @@ declare const openaiTools: {
|
|
|
806
806
|
};
|
|
807
807
|
}, {
|
|
808
808
|
output: string;
|
|
809
|
-
}, {}>;
|
|
809
|
+
}, {}, {}>;
|
|
810
810
|
/**
|
|
811
811
|
* The shell tool allows the model to interact with your local computer through
|
|
812
812
|
* a controlled command-line interface. The model proposes shell commands; your
|
|
@@ -876,7 +876,7 @@ declare const openaiTools: {
|
|
|
876
876
|
path: string;
|
|
877
877
|
}>;
|
|
878
878
|
};
|
|
879
|
-
}>;
|
|
879
|
+
}, {}>;
|
|
880
880
|
/**
|
|
881
881
|
* Web search allows models to access up-to-date information from the internet
|
|
882
882
|
* and provide answers with sourced citations.
|
|
@@ -905,7 +905,7 @@ declare const openaiTools: {
|
|
|
905
905
|
region?: string;
|
|
906
906
|
timezone?: string;
|
|
907
907
|
};
|
|
908
|
-
}>;
|
|
908
|
+
}, {}>;
|
|
909
909
|
/**
|
|
910
910
|
* Web search allows models to access up-to-date information from the internet
|
|
911
911
|
* and provide answers with sourced citations.
|
|
@@ -933,7 +933,7 @@ declare const openaiTools: {
|
|
|
933
933
|
type: "api";
|
|
934
934
|
name: string;
|
|
935
935
|
}>;
|
|
936
|
-
}>;
|
|
936
|
+
}, {}>;
|
|
937
937
|
/**
|
|
938
938
|
* MCP (Model Context Protocol) allows models to call tools exposed by
|
|
939
939
|
* remote MCP servers or service connectors.
|
|
@@ -970,7 +970,7 @@ declare const openaiTools: {
|
|
|
970
970
|
arguments: string;
|
|
971
971
|
output?: string | null;
|
|
972
972
|
error?: _ai_sdk_provider.JSONValue;
|
|
973
|
-
}>;
|
|
973
|
+
}, {}>;
|
|
974
974
|
/**
|
|
975
975
|
* Tool search allows the model to dynamically search for and load deferred
|
|
976
976
|
* tools into the model's context as needed. This helps reduce overall token
|
|
@@ -989,12 +989,12 @@ declare const openaiTools: {
|
|
|
989
989
|
execution?: "server" | "client";
|
|
990
990
|
description?: string;
|
|
991
991
|
parameters?: Record<string, unknown>;
|
|
992
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
992
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
993
993
|
arguments?: unknown;
|
|
994
994
|
call_id?: string | null;
|
|
995
995
|
}, {
|
|
996
996
|
tools: Array<_ai_sdk_provider.JSONObject>;
|
|
997
|
-
}>;
|
|
997
|
+
}, {}>;
|
|
998
998
|
};
|
|
999
999
|
|
|
1000
1000
|
type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-chat-latest' | 'gpt-5.3-codex' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
|
package/dist/index.d.ts
CHANGED
|
@@ -141,7 +141,7 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
|
|
|
141
141
|
*/
|
|
142
142
|
timezone?: string;
|
|
143
143
|
};
|
|
144
|
-
}>;
|
|
144
|
+
}, {}>;
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
147
|
* A filter used to compare a specified attribute key to a given value using a defined comparison operation.
|
|
@@ -648,7 +648,7 @@ declare const customToolFactory: _ai_sdk_provider_utils.ProviderToolFactory<stri
|
|
|
648
648
|
} | {
|
|
649
649
|
type: "text";
|
|
650
650
|
};
|
|
651
|
-
}>;
|
|
651
|
+
}, {}>;
|
|
652
652
|
|
|
653
653
|
/**
|
|
654
654
|
* Type definitions for the apply_patch operations.
|
|
@@ -695,7 +695,7 @@ declare const openaiTools: {
|
|
|
695
695
|
}, {
|
|
696
696
|
status: "completed" | "failed";
|
|
697
697
|
output?: string;
|
|
698
|
-
}, {}>;
|
|
698
|
+
}, {}, {}>;
|
|
699
699
|
/**
|
|
700
700
|
* Custom tools let callers constrain model output to a grammar (regex or
|
|
701
701
|
* Lark syntax). The model returns a `custom_tool_call` output item whose
|
|
@@ -704,7 +704,7 @@ declare const openaiTools: {
|
|
|
704
704
|
* @param description - An optional description of the tool.
|
|
705
705
|
* @param format - The output format constraint (grammar type, syntax, and definition).
|
|
706
706
|
*/
|
|
707
|
-
customTool: (args: Parameters<typeof customToolFactory>[0]) => _ai_sdk_provider_utils.Tool<string, unknown>;
|
|
707
|
+
customTool: (args: Parameters<typeof customToolFactory>[0]) => _ai_sdk_provider_utils.Tool<string, unknown, {}>;
|
|
708
708
|
/**
|
|
709
709
|
* The Code Interpreter tool allows models to write and run Python code in a
|
|
710
710
|
* sandboxed environment to solve complex problems in domains like data analysis,
|
|
@@ -727,7 +727,7 @@ declare const openaiTools: {
|
|
|
727
727
|
type: "image";
|
|
728
728
|
url: string;
|
|
729
729
|
}> | null;
|
|
730
|
-
}>;
|
|
730
|
+
}, {}>;
|
|
731
731
|
/**
|
|
732
732
|
* File search is a tool available in the Responses API. It enables models to
|
|
733
733
|
* retrieve information in a knowledge base of previously uploaded files through
|
|
@@ -755,7 +755,7 @@ declare const openaiTools: {
|
|
|
755
755
|
scoreThreshold?: number;
|
|
756
756
|
};
|
|
757
757
|
filters?: OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter;
|
|
758
|
-
}>;
|
|
758
|
+
}, {}>;
|
|
759
759
|
/**
|
|
760
760
|
* The image generation tool allows you to generate images using a text prompt,
|
|
761
761
|
* and optionally image inputs. It leverages the GPT Image model,
|
|
@@ -788,7 +788,7 @@ declare const openaiTools: {
|
|
|
788
788
|
size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024";
|
|
789
789
|
}) => _ai_sdk_provider_utils.Tool<{}, {
|
|
790
790
|
result: string;
|
|
791
|
-
}>;
|
|
791
|
+
}, {}>;
|
|
792
792
|
/**
|
|
793
793
|
* Local shell is a tool that allows agents to run shell commands locally
|
|
794
794
|
* on a machine you or the user provides.
|
|
@@ -806,7 +806,7 @@ declare const openaiTools: {
|
|
|
806
806
|
};
|
|
807
807
|
}, {
|
|
808
808
|
output: string;
|
|
809
|
-
}, {}>;
|
|
809
|
+
}, {}, {}>;
|
|
810
810
|
/**
|
|
811
811
|
* The shell tool allows the model to interact with your local computer through
|
|
812
812
|
* a controlled command-line interface. The model proposes shell commands; your
|
|
@@ -876,7 +876,7 @@ declare const openaiTools: {
|
|
|
876
876
|
path: string;
|
|
877
877
|
}>;
|
|
878
878
|
};
|
|
879
|
-
}>;
|
|
879
|
+
}, {}>;
|
|
880
880
|
/**
|
|
881
881
|
* Web search allows models to access up-to-date information from the internet
|
|
882
882
|
* and provide answers with sourced citations.
|
|
@@ -905,7 +905,7 @@ declare const openaiTools: {
|
|
|
905
905
|
region?: string;
|
|
906
906
|
timezone?: string;
|
|
907
907
|
};
|
|
908
|
-
}>;
|
|
908
|
+
}, {}>;
|
|
909
909
|
/**
|
|
910
910
|
* Web search allows models to access up-to-date information from the internet
|
|
911
911
|
* and provide answers with sourced citations.
|
|
@@ -933,7 +933,7 @@ declare const openaiTools: {
|
|
|
933
933
|
type: "api";
|
|
934
934
|
name: string;
|
|
935
935
|
}>;
|
|
936
|
-
}>;
|
|
936
|
+
}, {}>;
|
|
937
937
|
/**
|
|
938
938
|
* MCP (Model Context Protocol) allows models to call tools exposed by
|
|
939
939
|
* remote MCP servers or service connectors.
|
|
@@ -970,7 +970,7 @@ declare const openaiTools: {
|
|
|
970
970
|
arguments: string;
|
|
971
971
|
output?: string | null;
|
|
972
972
|
error?: _ai_sdk_provider.JSONValue;
|
|
973
|
-
}>;
|
|
973
|
+
}, {}>;
|
|
974
974
|
/**
|
|
975
975
|
* Tool search allows the model to dynamically search for and load deferred
|
|
976
976
|
* tools into the model's context as needed. This helps reduce overall token
|
|
@@ -989,12 +989,12 @@ declare const openaiTools: {
|
|
|
989
989
|
execution?: "server" | "client";
|
|
990
990
|
description?: string;
|
|
991
991
|
parameters?: Record<string, unknown>;
|
|
992
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
992
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
993
993
|
arguments?: unknown;
|
|
994
994
|
call_id?: string | null;
|
|
995
995
|
}, {
|
|
996
996
|
tools: Array<_ai_sdk_provider.JSONObject>;
|
|
997
|
-
}>;
|
|
997
|
+
}, {}>;
|
|
998
998
|
};
|
|
999
999
|
|
|
1000
1000
|
type OpenAIResponsesModelId = 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.2-codex' | 'gpt-5.3-chat-latest' | 'gpt-5.3-codex' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | 'o4-mini' | 'o4-mini-2025-04-16' | (string & {});
|
package/dist/index.js
CHANGED
|
@@ -6727,7 +6727,7 @@ var OpenAITranscriptionModel = class {
|
|
|
6727
6727
|
};
|
|
6728
6728
|
|
|
6729
6729
|
// src/version.ts
|
|
6730
|
-
var VERSION = true ? "4.0.0-beta.
|
|
6730
|
+
var VERSION = true ? "4.0.0-beta.19" : "0.0.0-test";
|
|
6731
6731
|
|
|
6732
6732
|
// src/openai-provider.ts
|
|
6733
6733
|
function createOpenAI(options = {}) {
|
package/dist/index.mjs
CHANGED
|
@@ -6820,7 +6820,7 @@ var OpenAITranscriptionModel = class {
|
|
|
6820
6820
|
};
|
|
6821
6821
|
|
|
6822
6822
|
// src/version.ts
|
|
6823
|
-
var VERSION = true ? "4.0.0-beta.
|
|
6823
|
+
var VERSION = true ? "4.0.0-beta.19" : "0.0.0-test";
|
|
6824
6824
|
|
|
6825
6825
|
// src/openai-provider.ts
|
|
6826
6826
|
function createOpenAI(options = {}) {
|
|
@@ -838,7 +838,7 @@ declare const applyPatchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryW
|
|
|
838
838
|
* (e.g., patch results or errors).
|
|
839
839
|
*/
|
|
840
840
|
output?: string;
|
|
841
|
-
}, {}>;
|
|
841
|
+
}, {}, {}>;
|
|
842
842
|
/**
|
|
843
843
|
* The apply_patch tool lets GPT-5.1 create, update, and delete files in your
|
|
844
844
|
* codebase using structured diffs. Instead of just suggesting edits, the model
|
|
@@ -866,7 +866,7 @@ declare const applyPatch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSc
|
|
|
866
866
|
* (e.g., patch results or errors).
|
|
867
867
|
*/
|
|
868
868
|
output?: string;
|
|
869
|
-
}, {}>;
|
|
869
|
+
}, {}, {}>;
|
|
870
870
|
|
|
871
871
|
declare const codeInterpreterInputSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
872
872
|
containerId: string;
|
|
@@ -923,7 +923,7 @@ declare const codeInterpreterToolFactory: _ai_sdk_provider_utils.ProviderToolFac
|
|
|
923
923
|
*/
|
|
924
924
|
url: string;
|
|
925
925
|
}> | null;
|
|
926
|
-
}, CodeInterpreterArgs>;
|
|
926
|
+
}, CodeInterpreterArgs, {}>;
|
|
927
927
|
declare const codeInterpreter: (args?: CodeInterpreterArgs) => _ai_sdk_provider_utils.Tool<{
|
|
928
928
|
/**
|
|
929
929
|
* The code to run, or null if not available.
|
|
@@ -951,7 +951,7 @@ declare const codeInterpreter: (args?: CodeInterpreterArgs) => _ai_sdk_provider_
|
|
|
951
951
|
*/
|
|
952
952
|
url: string;
|
|
953
953
|
}> | null;
|
|
954
|
-
}>;
|
|
954
|
+
}, {}>;
|
|
955
955
|
|
|
956
956
|
declare const fileSearchArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
957
957
|
vectorStoreIds: string[];
|
|
@@ -1034,7 +1034,7 @@ declare const fileSearch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSc
|
|
|
1034
1034
|
* A filter to apply.
|
|
1035
1035
|
*/
|
|
1036
1036
|
filters?: OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter;
|
|
1037
|
-
}>;
|
|
1037
|
+
}, {}>;
|
|
1038
1038
|
|
|
1039
1039
|
declare const imageGenerationArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1040
1040
|
background?: "auto" | "transparent" | "opaque" | undefined;
|
|
@@ -1115,7 +1115,7 @@ declare const imageGeneration: (args?: ImageGenerationArgs) => _ai_sdk_provider_
|
|
|
1115
1115
|
* The generated image encoded in base64.
|
|
1116
1116
|
*/
|
|
1117
1117
|
result: string;
|
|
1118
|
-
}>;
|
|
1118
|
+
}, {}>;
|
|
1119
1119
|
|
|
1120
1120
|
declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1121
1121
|
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
@@ -1198,6 +1198,6 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOu
|
|
|
1198
1198
|
*/
|
|
1199
1199
|
timezone?: string;
|
|
1200
1200
|
};
|
|
1201
|
-
}>;
|
|
1201
|
+
}, {}>;
|
|
1202
1202
|
|
|
1203
1203
|
export { type ApplyPatchOperation, OpenAIChatLanguageModel, type OpenAIChatModelId, OpenAICompletionLanguageModel, type OpenAICompletionModelId, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingModelOptions, OpenAIImageModel, type OpenAIImageModelId, type OpenAILanguageModelChatOptions, type OpenAILanguageModelCompletionOptions, OpenAIResponsesLanguageModel, OpenAISpeechModel, type OpenAISpeechModelId, type OpenAISpeechModelOptions, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionModelOptions, type OpenaiResponsesCompactionProviderMetadata, type OpenaiResponsesProviderMetadata, type OpenaiResponsesReasoningProviderMetadata, type OpenaiResponsesSourceDocumentProviderMetadata, type OpenaiResponsesTextProviderMetadata, type ResponsesCompactionProviderMetadata, type ResponsesProviderMetadata, type ResponsesReasoningProviderMetadata, type ResponsesSourceDocumentProviderMetadata, type ResponsesTextProviderMetadata, applyPatch, applyPatchArgsSchema, applyPatchInputSchema, applyPatchOutputSchema, applyPatchToolFactory, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, hasDefaultResponseFormat, imageGeneration, imageGenerationArgsSchema, imageGenerationOutputSchema, modelMaxImagesPerCall, openAITranscriptionModelOptions, openaiEmbeddingModelOptions, openaiLanguageModelChatOptions, openaiLanguageModelCompletionOptions, openaiSpeechModelOptionsSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema };
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -838,7 +838,7 @@ declare const applyPatchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryW
|
|
|
838
838
|
* (e.g., patch results or errors).
|
|
839
839
|
*/
|
|
840
840
|
output?: string;
|
|
841
|
-
}, {}>;
|
|
841
|
+
}, {}, {}>;
|
|
842
842
|
/**
|
|
843
843
|
* The apply_patch tool lets GPT-5.1 create, update, and delete files in your
|
|
844
844
|
* codebase using structured diffs. Instead of just suggesting edits, the model
|
|
@@ -866,7 +866,7 @@ declare const applyPatch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSc
|
|
|
866
866
|
* (e.g., patch results or errors).
|
|
867
867
|
*/
|
|
868
868
|
output?: string;
|
|
869
|
-
}, {}>;
|
|
869
|
+
}, {}, {}>;
|
|
870
870
|
|
|
871
871
|
declare const codeInterpreterInputSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
872
872
|
containerId: string;
|
|
@@ -923,7 +923,7 @@ declare const codeInterpreterToolFactory: _ai_sdk_provider_utils.ProviderToolFac
|
|
|
923
923
|
*/
|
|
924
924
|
url: string;
|
|
925
925
|
}> | null;
|
|
926
|
-
}, CodeInterpreterArgs>;
|
|
926
|
+
}, CodeInterpreterArgs, {}>;
|
|
927
927
|
declare const codeInterpreter: (args?: CodeInterpreterArgs) => _ai_sdk_provider_utils.Tool<{
|
|
928
928
|
/**
|
|
929
929
|
* The code to run, or null if not available.
|
|
@@ -951,7 +951,7 @@ declare const codeInterpreter: (args?: CodeInterpreterArgs) => _ai_sdk_provider_
|
|
|
951
951
|
*/
|
|
952
952
|
url: string;
|
|
953
953
|
}> | null;
|
|
954
|
-
}>;
|
|
954
|
+
}, {}>;
|
|
955
955
|
|
|
956
956
|
declare const fileSearchArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
957
957
|
vectorStoreIds: string[];
|
|
@@ -1034,7 +1034,7 @@ declare const fileSearch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSc
|
|
|
1034
1034
|
* A filter to apply.
|
|
1035
1035
|
*/
|
|
1036
1036
|
filters?: OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter;
|
|
1037
|
-
}>;
|
|
1037
|
+
}, {}>;
|
|
1038
1038
|
|
|
1039
1039
|
declare const imageGenerationArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1040
1040
|
background?: "auto" | "transparent" | "opaque" | undefined;
|
|
@@ -1115,7 +1115,7 @@ declare const imageGeneration: (args?: ImageGenerationArgs) => _ai_sdk_provider_
|
|
|
1115
1115
|
* The generated image encoded in base64.
|
|
1116
1116
|
*/
|
|
1117
1117
|
result: string;
|
|
1118
|
-
}>;
|
|
1118
|
+
}, {}>;
|
|
1119
1119
|
|
|
1120
1120
|
declare const webSearchPreviewArgsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1121
1121
|
searchContextSize?: "low" | "medium" | "high" | undefined;
|
|
@@ -1198,6 +1198,6 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOu
|
|
|
1198
1198
|
*/
|
|
1199
1199
|
timezone?: string;
|
|
1200
1200
|
};
|
|
1201
|
-
}>;
|
|
1201
|
+
}, {}>;
|
|
1202
1202
|
|
|
1203
1203
|
export { type ApplyPatchOperation, OpenAIChatLanguageModel, type OpenAIChatModelId, OpenAICompletionLanguageModel, type OpenAICompletionModelId, OpenAIEmbeddingModel, type OpenAIEmbeddingModelId, type OpenAIEmbeddingModelOptions, OpenAIImageModel, type OpenAIImageModelId, type OpenAILanguageModelChatOptions, type OpenAILanguageModelCompletionOptions, OpenAIResponsesLanguageModel, OpenAISpeechModel, type OpenAISpeechModelId, type OpenAISpeechModelOptions, type OpenAITranscriptionCallOptions, OpenAITranscriptionModel, type OpenAITranscriptionModelId, type OpenAITranscriptionModelOptions, type OpenaiResponsesCompactionProviderMetadata, type OpenaiResponsesProviderMetadata, type OpenaiResponsesReasoningProviderMetadata, type OpenaiResponsesSourceDocumentProviderMetadata, type OpenaiResponsesTextProviderMetadata, type ResponsesCompactionProviderMetadata, type ResponsesProviderMetadata, type ResponsesReasoningProviderMetadata, type ResponsesSourceDocumentProviderMetadata, type ResponsesTextProviderMetadata, applyPatch, applyPatchArgsSchema, applyPatchInputSchema, applyPatchOutputSchema, applyPatchToolFactory, codeInterpreter, codeInterpreterArgsSchema, codeInterpreterInputSchema, codeInterpreterOutputSchema, codeInterpreterToolFactory, fileSearch, fileSearchArgsSchema, fileSearchOutputSchema, hasDefaultResponseFormat, imageGeneration, imageGenerationArgsSchema, imageGenerationOutputSchema, modelMaxImagesPerCall, openAITranscriptionModelOptions, openaiEmbeddingModelOptions, openaiLanguageModelChatOptions, openaiLanguageModelCompletionOptions, openaiSpeechModelOptionsSchema, webSearchPreview, webSearchPreviewArgsSchema, webSearchPreviewInputSchema };
|
package/docs/03-openai.mdx
CHANGED
|
@@ -769,7 +769,7 @@ const result = await generateText({
|
|
|
769
769
|
}),
|
|
770
770
|
},
|
|
771
771
|
prompt: 'List the files in my home directory.',
|
|
772
|
-
stopWhen:
|
|
772
|
+
stopWhen: isStepCount(2),
|
|
773
773
|
});
|
|
774
774
|
```
|
|
775
775
|
|
|
@@ -927,7 +927,7 @@ const result = await generateText({
|
|
|
927
927
|
}),
|
|
928
928
|
},
|
|
929
929
|
prompt: 'Use the skill to solve this problem.',
|
|
930
|
-
stopWhen:
|
|
930
|
+
stopWhen: isStepCount(5),
|
|
931
931
|
});
|
|
932
932
|
```
|
|
933
933
|
|
|
@@ -942,7 +942,7 @@ enabling iterative, multi-step code editing workflows.
|
|
|
942
942
|
|
|
943
943
|
```ts
|
|
944
944
|
import { openai } from '@ai-sdk/openai';
|
|
945
|
-
import { generateText,
|
|
945
|
+
import { generateText, isStepCount } from 'ai';
|
|
946
946
|
|
|
947
947
|
const result = await generateText({
|
|
948
948
|
model: openai('gpt-5.1'),
|
|
@@ -954,7 +954,7 @@ const result = await generateText({
|
|
|
954
954
|
}),
|
|
955
955
|
},
|
|
956
956
|
prompt: 'Create a python file that calculates the factorial of a number',
|
|
957
|
-
stopWhen:
|
|
957
|
+
stopWhen: isStepCount(5),
|
|
958
958
|
});
|
|
959
959
|
```
|
|
960
960
|
|
|
@@ -982,13 +982,13 @@ Add `openai.tools.toolSearch()` with no arguments and mark your tools with `defe
|
|
|
982
982
|
|
|
983
983
|
```ts
|
|
984
984
|
import { openai } from '@ai-sdk/openai';
|
|
985
|
-
import { generateText, tool,
|
|
985
|
+
import { generateText, tool, isStepCount } from 'ai';
|
|
986
986
|
import { z } from 'zod';
|
|
987
987
|
|
|
988
988
|
const result = await generateText({
|
|
989
989
|
model: openai.responses('gpt-5.4'),
|
|
990
990
|
prompt: 'What is the weather in San Francisco?',
|
|
991
|
-
stopWhen:
|
|
991
|
+
stopWhen: isStepCount(10),
|
|
992
992
|
tools: {
|
|
993
993
|
toolSearch: openai.tools.toolSearch(),
|
|
994
994
|
|
|
@@ -1033,13 +1033,13 @@ a `description`, `parameters` schema, and an `execute` callback:
|
|
|
1033
1033
|
|
|
1034
1034
|
```ts
|
|
1035
1035
|
import { openai } from '@ai-sdk/openai';
|
|
1036
|
-
import { generateText, tool,
|
|
1036
|
+
import { generateText, tool, isStepCount } from 'ai';
|
|
1037
1037
|
import { z } from 'zod';
|
|
1038
1038
|
|
|
1039
1039
|
const result = await generateText({
|
|
1040
1040
|
model: openai.responses('gpt-5.4'),
|
|
1041
1041
|
prompt: 'What is the weather in San Francisco?',
|
|
1042
|
-
stopWhen:
|
|
1042
|
+
stopWhen: isStepCount(10),
|
|
1043
1043
|
tools: {
|
|
1044
1044
|
toolSearch: openai.tools.toolSearch({
|
|
1045
1045
|
execution: 'client',
|
|
@@ -1113,7 +1113,7 @@ SQL queries, code snippets, or any output that must match a specific pattern.
|
|
|
1113
1113
|
|
|
1114
1114
|
```ts
|
|
1115
1115
|
import { openai } from '@ai-sdk/openai';
|
|
1116
|
-
import { generateText,
|
|
1116
|
+
import { generateText, isStepCount } from 'ai';
|
|
1117
1117
|
|
|
1118
1118
|
const result = await generateText({
|
|
1119
1119
|
model: openai.responses('gpt-5.2-codex'),
|
|
@@ -1134,7 +1134,7 @@ const result = await generateText({
|
|
|
1134
1134
|
},
|
|
1135
1135
|
toolChoice: 'required',
|
|
1136
1136
|
prompt: 'Write a SQL query to get all users older than 25.',
|
|
1137
|
-
stopWhen:
|
|
1137
|
+
stopWhen: isStepCount(3),
|
|
1138
1138
|
});
|
|
1139
1139
|
```
|
|
1140
1140
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/openai",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.19",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@ai-sdk/provider": "4.0.0-beta.5",
|
|
40
|
-
"@ai-sdk/provider-utils": "5.0.0-beta.
|
|
40
|
+
"@ai-sdk/provider-utils": "5.0.0-beta.9"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|