@ai-sdk/openai 3.0.0-beta.72 → 3.0.0-beta.73
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 +9 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +11 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -20
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +3 -3
- package/dist/internal/index.d.ts +3 -3
- package/dist/internal/index.js +10 -12
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +17 -19
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.73
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 544d4e8: chore(specification): rename v3 provider defined tool to provider tool
|
|
8
|
+
- Updated dependencies [544d4e8]
|
|
9
|
+
- @ai-sdk/provider-utils@4.0.0-beta.40
|
|
10
|
+
- @ai-sdk/provider@3.0.0-beta.22
|
|
11
|
+
|
|
3
12
|
## 3.0.0-beta.72
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -30,7 +30,7 @@ type OpenAIEmbeddingModelId = 'text-embedding-3-small' | 'text-embedding-3-large
|
|
|
30
30
|
|
|
31
31
|
type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | (string & {});
|
|
32
32
|
|
|
33
|
-
declare const webSearchToolFactory: _ai_sdk_provider_utils.
|
|
33
|
+
declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
34
34
|
/**
|
|
35
35
|
* An object describing the specific action taken in this web search call.
|
|
36
36
|
* Includes details on how the model used the web (search, open_page, find).
|
|
@@ -194,7 +194,7 @@ declare const openaiTools: {
|
|
|
194
194
|
* @param ranking - The ranking options to use for the file search.
|
|
195
195
|
* @param filters - The filters to use for the file search.
|
|
196
196
|
*/
|
|
197
|
-
fileSearch: _ai_sdk_provider_utils.
|
|
197
|
+
fileSearch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
198
198
|
queries: string[];
|
|
199
199
|
results: null | {
|
|
200
200
|
attributes: Record<string, unknown>;
|
|
@@ -251,7 +251,7 @@ declare const openaiTools: {
|
|
|
251
251
|
*
|
|
252
252
|
* Supported models: `gpt-5-codex` and `codex-mini-latest`
|
|
253
253
|
*/
|
|
254
|
-
localShell: _ai_sdk_provider_utils.
|
|
254
|
+
localShell: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
|
|
255
255
|
action: {
|
|
256
256
|
type: "exec";
|
|
257
257
|
command: string[];
|
|
@@ -270,7 +270,7 @@ declare const openaiTools: {
|
|
|
270
270
|
* @param searchContextSize - The search context size to use for the web search.
|
|
271
271
|
* @param userLocation - The user location to use for the web search.
|
|
272
272
|
*/
|
|
273
|
-
webSearchPreview: _ai_sdk_provider_utils.
|
|
273
|
+
webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
274
274
|
action: {
|
|
275
275
|
type: "search";
|
|
276
276
|
query?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ type OpenAIEmbeddingModelId = 'text-embedding-3-small' | 'text-embedding-3-large
|
|
|
30
30
|
|
|
31
31
|
type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | (string & {});
|
|
32
32
|
|
|
33
|
-
declare const webSearchToolFactory: _ai_sdk_provider_utils.
|
|
33
|
+
declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
34
34
|
/**
|
|
35
35
|
* An object describing the specific action taken in this web search call.
|
|
36
36
|
* Includes details on how the model used the web (search, open_page, find).
|
|
@@ -194,7 +194,7 @@ declare const openaiTools: {
|
|
|
194
194
|
* @param ranking - The ranking options to use for the file search.
|
|
195
195
|
* @param filters - The filters to use for the file search.
|
|
196
196
|
*/
|
|
197
|
-
fileSearch: _ai_sdk_provider_utils.
|
|
197
|
+
fileSearch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
198
198
|
queries: string[];
|
|
199
199
|
results: null | {
|
|
200
200
|
attributes: Record<string, unknown>;
|
|
@@ -251,7 +251,7 @@ declare const openaiTools: {
|
|
|
251
251
|
*
|
|
252
252
|
* Supported models: `gpt-5-codex` and `codex-mini-latest`
|
|
253
253
|
*/
|
|
254
|
-
localShell: _ai_sdk_provider_utils.
|
|
254
|
+
localShell: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
|
|
255
255
|
action: {
|
|
256
256
|
type: "exec";
|
|
257
257
|
command: string[];
|
|
@@ -270,7 +270,7 @@ declare const openaiTools: {
|
|
|
270
270
|
* @param searchContextSize - The search context size to use for the web search.
|
|
271
271
|
* @param userLocation - The user location to use for the web search.
|
|
272
272
|
*/
|
|
273
|
-
webSearchPreview: _ai_sdk_provider_utils.
|
|
273
|
+
webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
274
274
|
action: {
|
|
275
275
|
type: "search";
|
|
276
276
|
query?: string;
|
package/dist/index.js
CHANGED
|
@@ -1788,7 +1788,7 @@ var codeInterpreterArgsSchema = (0, import_provider_utils14.lazySchema)(
|
|
|
1788
1788
|
})
|
|
1789
1789
|
)
|
|
1790
1790
|
);
|
|
1791
|
-
var codeInterpreterToolFactory = (0, import_provider_utils14.
|
|
1791
|
+
var codeInterpreterToolFactory = (0, import_provider_utils14.createProviderToolFactoryWithOutputSchema)({
|
|
1792
1792
|
id: "openai.code_interpreter",
|
|
1793
1793
|
inputSchema: codeInterpreterInputSchema,
|
|
1794
1794
|
outputSchema: codeInterpreterOutputSchema
|
|
@@ -1840,7 +1840,7 @@ var fileSearchOutputSchema = (0, import_provider_utils15.lazySchema)(
|
|
|
1840
1840
|
})
|
|
1841
1841
|
)
|
|
1842
1842
|
);
|
|
1843
|
-
var fileSearch = (0, import_provider_utils15.
|
|
1843
|
+
var fileSearch = (0, import_provider_utils15.createProviderToolFactoryWithOutputSchema)({
|
|
1844
1844
|
id: "openai.file_search",
|
|
1845
1845
|
inputSchema: import_v410.z.object({}),
|
|
1846
1846
|
outputSchema: fileSearchOutputSchema
|
|
@@ -1872,7 +1872,7 @@ var imageGenerationInputSchema = (0, import_provider_utils16.lazySchema)(() => (
|
|
|
1872
1872
|
var imageGenerationOutputSchema = (0, import_provider_utils16.lazySchema)(
|
|
1873
1873
|
() => (0, import_provider_utils16.zodSchema)(import_v411.z.object({ result: import_v411.z.string() }))
|
|
1874
1874
|
);
|
|
1875
|
-
var imageGenerationToolFactory = (0, import_provider_utils16.
|
|
1875
|
+
var imageGenerationToolFactory = (0, import_provider_utils16.createProviderToolFactoryWithOutputSchema)({
|
|
1876
1876
|
id: "openai.image_generation",
|
|
1877
1877
|
inputSchema: imageGenerationInputSchema,
|
|
1878
1878
|
outputSchema: imageGenerationOutputSchema
|
|
@@ -1901,7 +1901,7 @@ var localShellInputSchema = (0, import_provider_utils17.lazySchema)(
|
|
|
1901
1901
|
var localShellOutputSchema = (0, import_provider_utils17.lazySchema)(
|
|
1902
1902
|
() => (0, import_provider_utils17.zodSchema)(import_v412.z.object({ output: import_v412.z.string() }))
|
|
1903
1903
|
);
|
|
1904
|
-
var localShell = (0, import_provider_utils17.
|
|
1904
|
+
var localShell = (0, import_provider_utils17.createProviderToolFactoryWithOutputSchema)({
|
|
1905
1905
|
id: "openai.local_shell",
|
|
1906
1906
|
inputSchema: localShellInputSchema,
|
|
1907
1907
|
outputSchema: localShellOutputSchema
|
|
@@ -1954,7 +1954,7 @@ var webSearchOutputSchema = (0, import_provider_utils18.lazySchema)(
|
|
|
1954
1954
|
})
|
|
1955
1955
|
)
|
|
1956
1956
|
);
|
|
1957
|
-
var webSearchToolFactory = (0, import_provider_utils18.
|
|
1957
|
+
var webSearchToolFactory = (0, import_provider_utils18.createProviderToolFactoryWithOutputSchema)({
|
|
1958
1958
|
id: "openai.web_search",
|
|
1959
1959
|
inputSchema: webSearchInputSchema,
|
|
1960
1960
|
outputSchema: webSearchOutputSchema
|
|
@@ -2002,7 +2002,7 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils19.lazySchema)(
|
|
|
2002
2002
|
})
|
|
2003
2003
|
)
|
|
2004
2004
|
);
|
|
2005
|
-
var webSearchPreview = (0, import_provider_utils19.
|
|
2005
|
+
var webSearchPreview = (0, import_provider_utils19.createProviderToolFactoryWithOutputSchema)({
|
|
2006
2006
|
id: "openai.web_search_preview",
|
|
2007
2007
|
inputSchema: webSearchPreviewInputSchema,
|
|
2008
2008
|
outputSchema: webSearchPreviewOutputSchema
|
|
@@ -2088,7 +2088,7 @@ var mcpOutputSchema = (0, import_provider_utils20.lazySchema)(
|
|
|
2088
2088
|
])
|
|
2089
2089
|
)
|
|
2090
2090
|
);
|
|
2091
|
-
var mcpToolFactory = (0, import_provider_utils20.
|
|
2091
|
+
var mcpToolFactory = (0, import_provider_utils20.createProviderToolFactoryWithOutputSchema)({
|
|
2092
2092
|
id: "openai.mcp",
|
|
2093
2093
|
inputSchema: mcpInputSchema,
|
|
2094
2094
|
outputSchema: mcpOutputSchema
|
|
@@ -3227,7 +3227,7 @@ async function prepareResponsesTools({
|
|
|
3227
3227
|
strict: strictJsonSchema
|
|
3228
3228
|
});
|
|
3229
3229
|
break;
|
|
3230
|
-
case "provider
|
|
3230
|
+
case "provider": {
|
|
3231
3231
|
switch (tool.id) {
|
|
3232
3232
|
case "openai.file_search": {
|
|
3233
3233
|
const args = await (0, import_provider_utils24.validateTypes)({
|
|
@@ -3458,16 +3458,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3458
3458
|
}
|
|
3459
3459
|
}
|
|
3460
3460
|
function hasOpenAITool(id) {
|
|
3461
|
-
return (tools == null ? void 0 : tools.find(
|
|
3462
|
-
(tool) => tool.type === "provider-defined" && tool.id === id
|
|
3463
|
-
)) != null;
|
|
3461
|
+
return (tools == null ? void 0 : tools.find((tool) => tool.type === "provider" && tool.id === id)) != null;
|
|
3464
3462
|
}
|
|
3465
3463
|
const topLogprobs = typeof (openaiOptions == null ? void 0 : openaiOptions.logprobs) === "number" ? openaiOptions == null ? void 0 : openaiOptions.logprobs : (openaiOptions == null ? void 0 : openaiOptions.logprobs) === true ? TOP_LOGPROBS_MAX : void 0;
|
|
3466
3464
|
if (topLogprobs) {
|
|
3467
3465
|
addInclude("message.output_text.logprobs");
|
|
3468
3466
|
}
|
|
3469
3467
|
const webSearchToolName = (_c = tools == null ? void 0 : tools.find(
|
|
3470
|
-
(tool) => tool.type === "provider
|
|
3468
|
+
(tool) => tool.type === "provider" && (tool.id === "openai.web_search" || tool.id === "openai.web_search_preview")
|
|
3471
3469
|
)) == null ? void 0 : _c.name;
|
|
3472
3470
|
if (webSearchToolName) {
|
|
3473
3471
|
addInclude("web_search_call.action.sources");
|
|
@@ -4993,7 +4991,7 @@ var OpenAITranscriptionModel = class {
|
|
|
4993
4991
|
};
|
|
4994
4992
|
|
|
4995
4993
|
// src/version.ts
|
|
4996
|
-
var VERSION = true ? "3.0.0-beta.
|
|
4994
|
+
var VERSION = true ? "3.0.0-beta.73" : "0.0.0-test";
|
|
4997
4995
|
|
|
4998
4996
|
// src/openai-provider.ts
|
|
4999
4997
|
function createOpenAI(options = {}) {
|