@ai-sdk/openai 3.0.0-beta.72 → 3.0.0-beta.74
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 +59 -5
- package/dist/index.d.ts +59 -5
- package/dist/index.js +963 -771
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +933 -737
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +131 -4
- package/dist/internal/index.d.ts +131 -4
- package/dist/internal/index.js +906 -712
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +888 -695
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.74
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 88fc415: feat(openai): add the new provider 'apply_patch' tool
|
|
8
|
+
|
|
9
|
+
## 3.0.0-beta.73
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 544d4e8: chore(specification): rename v3 provider defined tool to provider tool
|
|
14
|
+
- Updated dependencies [544d4e8]
|
|
15
|
+
- @ai-sdk/provider-utils@4.0.0-beta.40
|
|
16
|
+
- @ai-sdk/provider@3.0.0-beta.22
|
|
17
|
+
|
|
3
18
|
## 3.0.0-beta.72
|
|
4
19
|
|
|
5
20
|
### 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).
|
|
@@ -160,7 +160,52 @@ type OpenAIResponsesFileSearchToolCompoundFilter = {
|
|
|
160
160
|
filters: Array<OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter>;
|
|
161
161
|
};
|
|
162
162
|
|
|
163
|
+
/**
|
|
164
|
+
* Type definitions for the apply_patch operations.
|
|
165
|
+
*/
|
|
166
|
+
type ApplyPatchOperation = {
|
|
167
|
+
type: 'create_file';
|
|
168
|
+
/**
|
|
169
|
+
* Path of the file to create relative to the workspace root.
|
|
170
|
+
*/
|
|
171
|
+
path: string;
|
|
172
|
+
/**
|
|
173
|
+
* Unified diff content to apply when creating the file.
|
|
174
|
+
*/
|
|
175
|
+
diff: string;
|
|
176
|
+
} | {
|
|
177
|
+
type: 'delete_file';
|
|
178
|
+
/**
|
|
179
|
+
* Path of the file to delete relative to the workspace root.
|
|
180
|
+
*/
|
|
181
|
+
path: string;
|
|
182
|
+
} | {
|
|
183
|
+
type: 'update_file';
|
|
184
|
+
/**
|
|
185
|
+
* Path of the file to update relative to the workspace root.
|
|
186
|
+
*/
|
|
187
|
+
path: string;
|
|
188
|
+
/**
|
|
189
|
+
* Unified diff content to apply to the existing file.
|
|
190
|
+
*/
|
|
191
|
+
diff: string;
|
|
192
|
+
};
|
|
193
|
+
|
|
163
194
|
declare const openaiTools: {
|
|
195
|
+
/**
|
|
196
|
+
* The apply_patch tool lets GPT-5.1 create, update, and delete files in your
|
|
197
|
+
* codebase using structured diffs. Instead of just suggesting edits, the model
|
|
198
|
+
* emits patch operations that your application applies and then reports back on,
|
|
199
|
+
* enabling iterative, multi-step code editing workflows.
|
|
200
|
+
*
|
|
201
|
+
*/
|
|
202
|
+
applyPatch: () => _ai_sdk_provider_utils.Tool<{
|
|
203
|
+
callId: string;
|
|
204
|
+
operation: ApplyPatchOperation;
|
|
205
|
+
}, {
|
|
206
|
+
status: "completed" | "failed";
|
|
207
|
+
output?: string;
|
|
208
|
+
}>;
|
|
164
209
|
/**
|
|
165
210
|
* The Code Interpreter tool allows models to write and run Python code in a
|
|
166
211
|
* sandboxed environment to solve complex problems in domains like data analysis,
|
|
@@ -194,7 +239,7 @@ declare const openaiTools: {
|
|
|
194
239
|
* @param ranking - The ranking options to use for the file search.
|
|
195
240
|
* @param filters - The filters to use for the file search.
|
|
196
241
|
*/
|
|
197
|
-
fileSearch: _ai_sdk_provider_utils.
|
|
242
|
+
fileSearch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
198
243
|
queries: string[];
|
|
199
244
|
results: null | {
|
|
200
245
|
attributes: Record<string, unknown>;
|
|
@@ -251,7 +296,7 @@ declare const openaiTools: {
|
|
|
251
296
|
*
|
|
252
297
|
* Supported models: `gpt-5-codex` and `codex-mini-latest`
|
|
253
298
|
*/
|
|
254
|
-
localShell: _ai_sdk_provider_utils.
|
|
299
|
+
localShell: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
|
|
255
300
|
action: {
|
|
256
301
|
type: "exec";
|
|
257
302
|
command: string[];
|
|
@@ -270,7 +315,7 @@ declare const openaiTools: {
|
|
|
270
315
|
* @param searchContextSize - The search context size to use for the web search.
|
|
271
316
|
* @param userLocation - The user location to use for the web search.
|
|
272
317
|
*/
|
|
273
|
-
webSearchPreview: _ai_sdk_provider_utils.
|
|
318
|
+
webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
274
319
|
action: {
|
|
275
320
|
type: "search";
|
|
276
321
|
query?: string;
|
|
@@ -289,7 +334,16 @@ declare const openaiTools: {
|
|
|
289
334
|
country?: string;
|
|
290
335
|
city?: string;
|
|
291
336
|
region?: string;
|
|
292
|
-
timezone
|
|
337
|
+
timezone
|
|
338
|
+
/**
|
|
339
|
+
* Web search allows models to access up-to-date information from the internet
|
|
340
|
+
* and provide answers with sourced citations.
|
|
341
|
+
*
|
|
342
|
+
* @param filters - The filters to use for the web search.
|
|
343
|
+
* @param searchContextSize - The search context size to use for the web search.
|
|
344
|
+
* @param userLocation - The user location to use for the web search.
|
|
345
|
+
*/
|
|
346
|
+
?: string;
|
|
293
347
|
};
|
|
294
348
|
}>;
|
|
295
349
|
/**
|
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).
|
|
@@ -160,7 +160,52 @@ type OpenAIResponsesFileSearchToolCompoundFilter = {
|
|
|
160
160
|
filters: Array<OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter>;
|
|
161
161
|
};
|
|
162
162
|
|
|
163
|
+
/**
|
|
164
|
+
* Type definitions for the apply_patch operations.
|
|
165
|
+
*/
|
|
166
|
+
type ApplyPatchOperation = {
|
|
167
|
+
type: 'create_file';
|
|
168
|
+
/**
|
|
169
|
+
* Path of the file to create relative to the workspace root.
|
|
170
|
+
*/
|
|
171
|
+
path: string;
|
|
172
|
+
/**
|
|
173
|
+
* Unified diff content to apply when creating the file.
|
|
174
|
+
*/
|
|
175
|
+
diff: string;
|
|
176
|
+
} | {
|
|
177
|
+
type: 'delete_file';
|
|
178
|
+
/**
|
|
179
|
+
* Path of the file to delete relative to the workspace root.
|
|
180
|
+
*/
|
|
181
|
+
path: string;
|
|
182
|
+
} | {
|
|
183
|
+
type: 'update_file';
|
|
184
|
+
/**
|
|
185
|
+
* Path of the file to update relative to the workspace root.
|
|
186
|
+
*/
|
|
187
|
+
path: string;
|
|
188
|
+
/**
|
|
189
|
+
* Unified diff content to apply to the existing file.
|
|
190
|
+
*/
|
|
191
|
+
diff: string;
|
|
192
|
+
};
|
|
193
|
+
|
|
163
194
|
declare const openaiTools: {
|
|
195
|
+
/**
|
|
196
|
+
* The apply_patch tool lets GPT-5.1 create, update, and delete files in your
|
|
197
|
+
* codebase using structured diffs. Instead of just suggesting edits, the model
|
|
198
|
+
* emits patch operations that your application applies and then reports back on,
|
|
199
|
+
* enabling iterative, multi-step code editing workflows.
|
|
200
|
+
*
|
|
201
|
+
*/
|
|
202
|
+
applyPatch: () => _ai_sdk_provider_utils.Tool<{
|
|
203
|
+
callId: string;
|
|
204
|
+
operation: ApplyPatchOperation;
|
|
205
|
+
}, {
|
|
206
|
+
status: "completed" | "failed";
|
|
207
|
+
output?: string;
|
|
208
|
+
}>;
|
|
164
209
|
/**
|
|
165
210
|
* The Code Interpreter tool allows models to write and run Python code in a
|
|
166
211
|
* sandboxed environment to solve complex problems in domains like data analysis,
|
|
@@ -194,7 +239,7 @@ declare const openaiTools: {
|
|
|
194
239
|
* @param ranking - The ranking options to use for the file search.
|
|
195
240
|
* @param filters - The filters to use for the file search.
|
|
196
241
|
*/
|
|
197
|
-
fileSearch: _ai_sdk_provider_utils.
|
|
242
|
+
fileSearch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
198
243
|
queries: string[];
|
|
199
244
|
results: null | {
|
|
200
245
|
attributes: Record<string, unknown>;
|
|
@@ -251,7 +296,7 @@ declare const openaiTools: {
|
|
|
251
296
|
*
|
|
252
297
|
* Supported models: `gpt-5-codex` and `codex-mini-latest`
|
|
253
298
|
*/
|
|
254
|
-
localShell: _ai_sdk_provider_utils.
|
|
299
|
+
localShell: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
|
|
255
300
|
action: {
|
|
256
301
|
type: "exec";
|
|
257
302
|
command: string[];
|
|
@@ -270,7 +315,7 @@ declare const openaiTools: {
|
|
|
270
315
|
* @param searchContextSize - The search context size to use for the web search.
|
|
271
316
|
* @param userLocation - The user location to use for the web search.
|
|
272
317
|
*/
|
|
273
|
-
webSearchPreview: _ai_sdk_provider_utils.
|
|
318
|
+
webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
274
319
|
action: {
|
|
275
320
|
type: "search";
|
|
276
321
|
query?: string;
|
|
@@ -289,7 +334,16 @@ declare const openaiTools: {
|
|
|
289
334
|
country?: string;
|
|
290
335
|
city?: string;
|
|
291
336
|
region?: string;
|
|
292
|
-
timezone
|
|
337
|
+
timezone
|
|
338
|
+
/**
|
|
339
|
+
* Web search allows models to access up-to-date information from the internet
|
|
340
|
+
* and provide answers with sourced citations.
|
|
341
|
+
*
|
|
342
|
+
* @param filters - The filters to use for the web search.
|
|
343
|
+
* @param searchContextSize - The search context size to use for the web search.
|
|
344
|
+
* @param userLocation - The user location to use for the web search.
|
|
345
|
+
*/
|
|
346
|
+
?: string;
|
|
293
347
|
};
|
|
294
348
|
}>;
|
|
295
349
|
/**
|