@ai-sdk/openai 0.0.0-013d7476-20250808163325 → 0.0.0-2f1ae29d-20260122140908

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.
Files changed (121) hide show
  1. package/CHANGELOG.md +1324 -228
  2. package/dist/index.d.mts +832 -85
  3. package/dist/index.d.ts +832 -85
  4. package/dist/index.js +3940 -1418
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +4039 -1469
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/internal/index.d.mts +954 -116
  9. package/dist/internal/index.d.ts +954 -116
  10. package/dist/internal/index.js +3798 -1342
  11. package/dist/internal/index.js.map +1 -1
  12. package/dist/internal/index.mjs +3728 -1245
  13. package/dist/internal/index.mjs.map +1 -1
  14. package/docs/03-openai.mdx +2018 -0
  15. package/package.json +13 -6
  16. package/src/chat/__fixtures__/azure-model-router.1.chunks.txt +8 -0
  17. package/src/chat/__snapshots__/openai-chat-language-model.test.ts.snap +88 -0
  18. package/src/chat/convert-openai-chat-usage.ts +57 -0
  19. package/src/chat/convert-to-openai-chat-messages.test.ts +516 -0
  20. package/src/chat/convert-to-openai-chat-messages.ts +225 -0
  21. package/src/chat/get-response-metadata.ts +15 -0
  22. package/src/chat/map-openai-finish-reason.ts +19 -0
  23. package/src/chat/openai-chat-api.ts +198 -0
  24. package/src/chat/openai-chat-language-model.test.ts +3496 -0
  25. package/src/chat/openai-chat-language-model.ts +700 -0
  26. package/src/chat/openai-chat-options.ts +186 -0
  27. package/src/chat/openai-chat-prepare-tools.test.ts +322 -0
  28. package/src/chat/openai-chat-prepare-tools.ts +84 -0
  29. package/src/chat/openai-chat-prompt.ts +70 -0
  30. package/src/completion/convert-openai-completion-usage.ts +46 -0
  31. package/src/completion/convert-to-openai-completion-prompt.ts +93 -0
  32. package/src/completion/get-response-metadata.ts +15 -0
  33. package/src/completion/map-openai-finish-reason.ts +19 -0
  34. package/src/completion/openai-completion-api.ts +81 -0
  35. package/src/completion/openai-completion-language-model.test.ts +752 -0
  36. package/src/completion/openai-completion-language-model.ts +336 -0
  37. package/src/completion/openai-completion-options.ts +58 -0
  38. package/src/embedding/__snapshots__/openai-embedding-model.test.ts.snap +43 -0
  39. package/src/embedding/openai-embedding-api.ts +13 -0
  40. package/src/embedding/openai-embedding-model.test.ts +146 -0
  41. package/src/embedding/openai-embedding-model.ts +95 -0
  42. package/src/embedding/openai-embedding-options.ts +30 -0
  43. package/src/image/openai-image-api.ts +35 -0
  44. package/src/image/openai-image-model.test.ts +722 -0
  45. package/src/image/openai-image-model.ts +305 -0
  46. package/src/image/openai-image-options.ts +28 -0
  47. package/src/index.ts +9 -0
  48. package/src/internal/index.ts +19 -0
  49. package/src/openai-config.ts +18 -0
  50. package/src/openai-error.test.ts +34 -0
  51. package/src/openai-error.ts +22 -0
  52. package/src/openai-language-model-capabilities.test.ts +93 -0
  53. package/src/openai-language-model-capabilities.ts +54 -0
  54. package/src/openai-provider.test.ts +98 -0
  55. package/src/openai-provider.ts +270 -0
  56. package/src/openai-tools.ts +114 -0
  57. package/src/responses/__fixtures__/openai-apply-patch-tool-delete.1.chunks.txt +5 -0
  58. package/src/responses/__fixtures__/openai-apply-patch-tool.1.chunks.txt +38 -0
  59. package/src/responses/__fixtures__/openai-apply-patch-tool.1.json +69 -0
  60. package/src/responses/__fixtures__/openai-code-interpreter-tool.1.chunks.txt +393 -0
  61. package/src/responses/__fixtures__/openai-code-interpreter-tool.1.json +137 -0
  62. package/src/responses/__fixtures__/openai-error.1.chunks.txt +4 -0
  63. package/src/responses/__fixtures__/openai-error.1.json +8 -0
  64. package/src/responses/__fixtures__/openai-file-search-tool.1.chunks.txt +94 -0
  65. package/src/responses/__fixtures__/openai-file-search-tool.1.json +89 -0
  66. package/src/responses/__fixtures__/openai-file-search-tool.2.chunks.txt +93 -0
  67. package/src/responses/__fixtures__/openai-file-search-tool.2.json +112 -0
  68. package/src/responses/__fixtures__/openai-image-generation-tool.1.chunks.txt +16 -0
  69. package/src/responses/__fixtures__/openai-image-generation-tool.1.json +96 -0
  70. package/src/responses/__fixtures__/openai-local-shell-tool.1.chunks.txt +7 -0
  71. package/src/responses/__fixtures__/openai-local-shell-tool.1.json +70 -0
  72. package/src/responses/__fixtures__/openai-mcp-tool-approval.1.chunks.txt +11 -0
  73. package/src/responses/__fixtures__/openai-mcp-tool-approval.1.json +169 -0
  74. package/src/responses/__fixtures__/openai-mcp-tool-approval.2.chunks.txt +123 -0
  75. package/src/responses/__fixtures__/openai-mcp-tool-approval.2.json +176 -0
  76. package/src/responses/__fixtures__/openai-mcp-tool-approval.3.chunks.txt +11 -0
  77. package/src/responses/__fixtures__/openai-mcp-tool-approval.3.json +169 -0
  78. package/src/responses/__fixtures__/openai-mcp-tool-approval.4.chunks.txt +84 -0
  79. package/src/responses/__fixtures__/openai-mcp-tool-approval.4.json +182 -0
  80. package/src/responses/__fixtures__/openai-mcp-tool.1.chunks.txt +373 -0
  81. package/src/responses/__fixtures__/openai-mcp-tool.1.json +159 -0
  82. package/src/responses/__fixtures__/openai-reasoning-encrypted-content.1.chunks.txt +110 -0
  83. package/src/responses/__fixtures__/openai-reasoning-encrypted-content.1.json +117 -0
  84. package/src/responses/__fixtures__/openai-shell-tool.1.chunks.txt +182 -0
  85. package/src/responses/__fixtures__/openai-shell-tool.1.json +73 -0
  86. package/src/responses/__fixtures__/openai-web-search-tool.1.chunks.txt +185 -0
  87. package/src/responses/__fixtures__/openai-web-search-tool.1.json +266 -0
  88. package/src/responses/__snapshots__/openai-responses-language-model.test.ts.snap +10955 -0
  89. package/src/responses/convert-openai-responses-usage.ts +53 -0
  90. package/src/responses/convert-to-openai-responses-input.test.ts +2976 -0
  91. package/src/responses/convert-to-openai-responses-input.ts +578 -0
  92. package/src/responses/map-openai-responses-finish-reason.ts +22 -0
  93. package/src/responses/openai-responses-api.test.ts +89 -0
  94. package/src/responses/openai-responses-api.ts +1086 -0
  95. package/src/responses/openai-responses-language-model.test.ts +6927 -0
  96. package/src/responses/openai-responses-language-model.ts +1932 -0
  97. package/src/responses/openai-responses-options.ts +312 -0
  98. package/src/responses/openai-responses-prepare-tools.test.ts +924 -0
  99. package/src/responses/openai-responses-prepare-tools.ts +264 -0
  100. package/src/responses/openai-responses-provider-metadata.ts +39 -0
  101. package/src/speech/openai-speech-api.ts +38 -0
  102. package/src/speech/openai-speech-model.test.ts +202 -0
  103. package/src/speech/openai-speech-model.ts +137 -0
  104. package/src/speech/openai-speech-options.ts +22 -0
  105. package/src/tool/apply-patch.ts +141 -0
  106. package/src/tool/code-interpreter.ts +104 -0
  107. package/src/tool/file-search.ts +145 -0
  108. package/src/tool/image-generation.ts +126 -0
  109. package/src/tool/local-shell.test-d.ts +20 -0
  110. package/src/tool/local-shell.ts +72 -0
  111. package/src/tool/mcp.ts +125 -0
  112. package/src/tool/shell.ts +85 -0
  113. package/src/tool/web-search-preview.ts +139 -0
  114. package/src/tool/web-search.test-d.ts +13 -0
  115. package/src/tool/web-search.ts +179 -0
  116. package/src/transcription/openai-transcription-api.ts +37 -0
  117. package/src/transcription/openai-transcription-model.test.ts +507 -0
  118. package/src/transcription/openai-transcription-model.ts +232 -0
  119. package/src/transcription/openai-transcription-options.ts +50 -0
  120. package/src/transcription/transcription-test.mp3 +0 -0
  121. package/src/version.ts +6 -0
package/dist/index.d.ts CHANGED
@@ -1,35 +1,709 @@
1
- import { LanguageModelV2, ProviderV2, EmbeddingModelV2, ImageModelV2, TranscriptionModelV2, SpeechModelV2 } from '@ai-sdk/provider';
1
+ import * as _ai_sdk_provider from '@ai-sdk/provider';
2
+ import { ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
2
3
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
- import { FetchFunction } from '@ai-sdk/provider-utils';
4
- import { z } from 'zod/v4';
4
+ import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
5
5
 
6
- type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview' | 'gpt-4o-mini-search-preview-2025-03-11' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo-preview' | 'gpt-4-0125-preview' | 'gpt-4-1106-preview' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | (string & {});
6
+ type OpenAIChatModelId = 'o1' | 'o1-2024-12-17' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o3' | 'o3-2025-04-16' | 'o4-mini' | 'o4-mini-2025-04-16' | 'gpt-4.1' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4' | 'gpt-4-0613' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-1106' | 'chatgpt-4o-latest' | 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | (string & {});
7
+ declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
8
+ logitBias?: Record<number, number> | undefined;
9
+ logprobs?: number | boolean | undefined;
10
+ parallelToolCalls?: boolean | undefined;
11
+ user?: string | undefined;
12
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
13
+ maxCompletionTokens?: number | undefined;
14
+ store?: boolean | undefined;
15
+ metadata?: Record<string, string> | undefined;
16
+ prediction?: Record<string, any> | undefined;
17
+ serviceTier?: "default" | "auto" | "flex" | "priority" | undefined;
18
+ strictJsonSchema?: boolean | undefined;
19
+ textVerbosity?: "low" | "medium" | "high" | undefined;
20
+ promptCacheKey?: string | undefined;
21
+ promptCacheRetention?: "in_memory" | "24h" | undefined;
22
+ safetyIdentifier?: string | undefined;
23
+ systemMessageMode?: "remove" | "system" | "developer" | undefined;
24
+ forceReasoning?: boolean | undefined;
25
+ }>;
26
+ type OpenAIChatLanguageModelOptions = InferSchema<typeof openaiChatLanguageModelOptions>;
7
27
 
8
28
  type OpenAICompletionModelId = 'gpt-3.5-turbo-instruct' | (string & {});
9
29
 
10
30
  type OpenAIEmbeddingModelId = 'text-embedding-3-small' | 'text-embedding-3-large' | 'text-embedding-ada-002' | (string & {});
11
31
 
12
- type OpenAIImageModelId = 'gpt-image-1' | 'dall-e-3' | 'dall-e-2' | (string & {});
32
+ type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | 'gpt-image-1.5' | (string & {});
33
+
34
+ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
35
+ /**
36
+ * An object describing the specific action taken in this web search call.
37
+ * Includes details on how the model used the web (search, open_page, find_in_page).
38
+ */
39
+ action: {
40
+ /**
41
+ * Action type "search" - Performs a web search query.
42
+ */
43
+ type: "search";
44
+ /**
45
+ * The search query.
46
+ */
47
+ query?: string;
48
+ } | {
49
+ /**
50
+ * Action type "openPage" - Opens a specific URL from search results.
51
+ */
52
+ type: "openPage";
53
+ /**
54
+ * The URL opened by the model.
55
+ */
56
+ url?: string | null;
57
+ } | {
58
+ /**
59
+ * Action type "findInPage": Searches for a pattern within a loaded page.
60
+ */
61
+ type: "findInPage";
62
+ /**
63
+ * The URL of the page searched for the pattern.
64
+ */
65
+ url?: string | null;
66
+ /**
67
+ * The pattern or text to search for within the page.
68
+ */
69
+ pattern?: string | null;
70
+ };
71
+ /**
72
+ * Optional sources cited by the model for the web search call.
73
+ */
74
+ sources?: Array<{
75
+ type: "url";
76
+ url: string;
77
+ } | {
78
+ type: "api";
79
+ name: string;
80
+ }>;
81
+ }, {
82
+ /**
83
+ * Whether to use external web access for fetching live content.
84
+ * - true: Fetch live web content (default)
85
+ * - false: Use cached/indexed results
86
+ */
87
+ externalWebAccess?: boolean;
88
+ /**
89
+ * Filters for the search.
90
+ */
91
+ filters?: {
92
+ /**
93
+ * Allowed domains for the search.
94
+ * If not provided, all domains are allowed.
95
+ * Subdomains of the provided domains are allowed as well.
96
+ */
97
+ allowedDomains?: string[];
98
+ };
99
+ /**
100
+ * Search context size to use for the web search.
101
+ * - high: Most comprehensive context, highest cost, slower response
102
+ * - medium: Balanced context, cost, and latency (default)
103
+ * - low: Least context, lowest cost, fastest response
104
+ */
105
+ searchContextSize?: "low" | "medium" | "high";
106
+ /**
107
+ * User location information to provide geographically relevant search results.
108
+ */
109
+ userLocation?: {
110
+ /**
111
+ * Type of location (always 'approximate')
112
+ */
113
+ type: "approximate";
114
+ /**
115
+ * Two-letter ISO country code (e.g., 'US', 'GB')
116
+ */
117
+ country?: string;
118
+ /**
119
+ * City name (free text, e.g., 'Minneapolis')
120
+ */
121
+ city?: string;
122
+ /**
123
+ * Region name (free text, e.g., 'Minnesota')
124
+ */
125
+ region?: string;
126
+ /**
127
+ * IANA timezone (e.g., 'America/Chicago')
128
+ */
129
+ timezone?: string;
130
+ };
131
+ }>;
132
+
133
+ /**
134
+ * A filter used to compare a specified attribute key to a given value using a defined comparison operation.
135
+ */
136
+ type OpenAIResponsesFileSearchToolComparisonFilter = {
137
+ /**
138
+ * The key to compare against the value.
139
+ */
140
+ key: string;
141
+ /**
142
+ * Specifies the comparison operator: eq, ne, gt, gte, lt, lte, in, nin.
143
+ */
144
+ type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin';
145
+ /**
146
+ * The value to compare against the attribute key; supports string, number, boolean, or array of string types.
147
+ */
148
+ value: string | number | boolean | string[];
149
+ };
150
+ /**
151
+ * Combine multiple filters using and or or.
152
+ */
153
+ type OpenAIResponsesFileSearchToolCompoundFilter = {
154
+ /**
155
+ * Type of operation: and or or.
156
+ */
157
+ type: 'and' | 'or';
158
+ /**
159
+ * Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.
160
+ */
161
+ filters: Array<OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter>;
162
+ };
163
+ declare const openaiResponsesChunkSchema: _ai_sdk_provider_utils.LazySchema<{
164
+ type: "unknown_chunk";
165
+ message: string;
166
+ } | {
167
+ type: "response.output_text.delta";
168
+ item_id: string;
169
+ delta: string;
170
+ logprobs?: {
171
+ token: string;
172
+ logprob: number;
173
+ top_logprobs: {
174
+ token: string;
175
+ logprob: number;
176
+ }[];
177
+ }[] | null | undefined;
178
+ } | {
179
+ type: "response.completed" | "response.incomplete";
180
+ response: {
181
+ usage: {
182
+ input_tokens: number;
183
+ output_tokens: number;
184
+ input_tokens_details?: {
185
+ cached_tokens?: number | null | undefined;
186
+ } | null | undefined;
187
+ output_tokens_details?: {
188
+ reasoning_tokens?: number | null | undefined;
189
+ } | null | undefined;
190
+ };
191
+ incomplete_details?: {
192
+ reason: string;
193
+ } | null | undefined;
194
+ service_tier?: string | null | undefined;
195
+ };
196
+ } | {
197
+ type: "response.created";
198
+ response: {
199
+ id: string;
200
+ created_at: number;
201
+ model: string;
202
+ service_tier?: string | null | undefined;
203
+ };
204
+ } | {
205
+ type: "response.output_item.added";
206
+ output_index: number;
207
+ item: {
208
+ type: "message";
209
+ id: string;
210
+ } | {
211
+ type: "reasoning";
212
+ id: string;
213
+ encrypted_content?: string | null | undefined;
214
+ } | {
215
+ type: "function_call";
216
+ id: string;
217
+ call_id: string;
218
+ name: string;
219
+ arguments: string;
220
+ } | {
221
+ type: "web_search_call";
222
+ id: string;
223
+ status: string;
224
+ } | {
225
+ type: "computer_call";
226
+ id: string;
227
+ status: string;
228
+ } | {
229
+ type: "file_search_call";
230
+ id: string;
231
+ } | {
232
+ type: "image_generation_call";
233
+ id: string;
234
+ } | {
235
+ type: "code_interpreter_call";
236
+ id: string;
237
+ container_id: string;
238
+ code: string | null;
239
+ outputs: ({
240
+ type: "logs";
241
+ logs: string;
242
+ } | {
243
+ type: "image";
244
+ url: string;
245
+ })[] | null;
246
+ status: string;
247
+ } | {
248
+ type: "mcp_call";
249
+ id: string;
250
+ status: string;
251
+ approval_request_id?: string | null | undefined;
252
+ } | {
253
+ type: "mcp_list_tools";
254
+ id: string;
255
+ } | {
256
+ type: "mcp_approval_request";
257
+ id: string;
258
+ } | {
259
+ type: "apply_patch_call";
260
+ id: string;
261
+ call_id: string;
262
+ status: "completed" | "in_progress";
263
+ operation: {
264
+ type: "create_file";
265
+ path: string;
266
+ diff: string;
267
+ } | {
268
+ type: "delete_file";
269
+ path: string;
270
+ } | {
271
+ type: "update_file";
272
+ path: string;
273
+ diff: string;
274
+ };
275
+ } | {
276
+ type: "shell_call";
277
+ id: string;
278
+ call_id: string;
279
+ status: "completed" | "in_progress" | "incomplete";
280
+ action: {
281
+ commands: string[];
282
+ };
283
+ };
284
+ } | {
285
+ type: "response.output_item.done";
286
+ output_index: number;
287
+ item: {
288
+ type: "message";
289
+ id: string;
290
+ } | {
291
+ type: "reasoning";
292
+ id: string;
293
+ encrypted_content?: string | null | undefined;
294
+ } | {
295
+ type: "function_call";
296
+ id: string;
297
+ call_id: string;
298
+ name: string;
299
+ arguments: string;
300
+ status: "completed";
301
+ } | {
302
+ type: "code_interpreter_call";
303
+ id: string;
304
+ code: string | null;
305
+ container_id: string;
306
+ outputs: ({
307
+ type: "logs";
308
+ logs: string;
309
+ } | {
310
+ type: "image";
311
+ url: string;
312
+ })[] | null;
313
+ } | {
314
+ type: "image_generation_call";
315
+ id: string;
316
+ result: string;
317
+ } | {
318
+ type: "web_search_call";
319
+ id: string;
320
+ status: string;
321
+ action: {
322
+ type: "search";
323
+ query?: string | null | undefined;
324
+ sources?: ({
325
+ type: "url";
326
+ url: string;
327
+ } | {
328
+ type: "api";
329
+ name: string;
330
+ })[] | null | undefined;
331
+ } | {
332
+ type: "open_page";
333
+ url?: string | null | undefined;
334
+ } | {
335
+ type: "find_in_page";
336
+ url?: string | null | undefined;
337
+ pattern?: string | null | undefined;
338
+ };
339
+ } | {
340
+ type: "file_search_call";
341
+ id: string;
342
+ queries: string[];
343
+ results?: {
344
+ attributes: Record<string, string | number | boolean>;
345
+ file_id: string;
346
+ filename: string;
347
+ score: number;
348
+ text: string;
349
+ }[] | null | undefined;
350
+ } | {
351
+ type: "local_shell_call";
352
+ id: string;
353
+ call_id: string;
354
+ action: {
355
+ type: "exec";
356
+ command: string[];
357
+ timeout_ms?: number | undefined;
358
+ user?: string | undefined;
359
+ working_directory?: string | undefined;
360
+ env?: Record<string, string> | undefined;
361
+ };
362
+ } | {
363
+ type: "computer_call";
364
+ id: string;
365
+ status: "completed";
366
+ } | {
367
+ type: "mcp_call";
368
+ id: string;
369
+ status: string;
370
+ arguments: string;
371
+ name: string;
372
+ server_label: string;
373
+ output?: string | null | undefined;
374
+ error?: string | {
375
+ [x: string]: unknown;
376
+ type?: string | undefined;
377
+ code?: string | number | undefined;
378
+ message?: string | undefined;
379
+ } | null | undefined;
380
+ approval_request_id?: string | null | undefined;
381
+ } | {
382
+ type: "mcp_list_tools";
383
+ id: string;
384
+ server_label: string;
385
+ tools: {
386
+ name: string;
387
+ input_schema: any;
388
+ description?: string | undefined;
389
+ annotations?: Record<string, unknown> | undefined;
390
+ }[];
391
+ error?: string | {
392
+ [x: string]: unknown;
393
+ type?: string | undefined;
394
+ code?: string | number | undefined;
395
+ message?: string | undefined;
396
+ } | undefined;
397
+ } | {
398
+ type: "mcp_approval_request";
399
+ id: string;
400
+ server_label: string;
401
+ name: string;
402
+ arguments: string;
403
+ approval_request_id?: string | undefined;
404
+ } | {
405
+ type: "apply_patch_call";
406
+ id: string;
407
+ call_id: string;
408
+ status: "completed" | "in_progress";
409
+ operation: {
410
+ type: "create_file";
411
+ path: string;
412
+ diff: string;
413
+ } | {
414
+ type: "delete_file";
415
+ path: string;
416
+ } | {
417
+ type: "update_file";
418
+ path: string;
419
+ diff: string;
420
+ };
421
+ } | {
422
+ type: "shell_call";
423
+ id: string;
424
+ call_id: string;
425
+ status: "completed" | "in_progress" | "incomplete";
426
+ action: {
427
+ commands: string[];
428
+ };
429
+ };
430
+ } | {
431
+ type: "response.function_call_arguments.delta";
432
+ item_id: string;
433
+ output_index: number;
434
+ delta: string;
435
+ } | {
436
+ type: "response.image_generation_call.partial_image";
437
+ item_id: string;
438
+ output_index: number;
439
+ partial_image_b64: string;
440
+ } | {
441
+ type: "response.code_interpreter_call_code.delta";
442
+ item_id: string;
443
+ output_index: number;
444
+ delta: string;
445
+ } | {
446
+ type: "response.code_interpreter_call_code.done";
447
+ item_id: string;
448
+ output_index: number;
449
+ code: string;
450
+ } | {
451
+ type: "response.output_text.annotation.added";
452
+ annotation: {
453
+ type: "url_citation";
454
+ start_index: number;
455
+ end_index: number;
456
+ url: string;
457
+ title: string;
458
+ } | {
459
+ type: "file_citation";
460
+ file_id: string;
461
+ filename: string;
462
+ index: number;
463
+ } | {
464
+ type: "container_file_citation";
465
+ container_id: string;
466
+ file_id: string;
467
+ filename: string;
468
+ start_index: number;
469
+ end_index: number;
470
+ } | {
471
+ type: "file_path";
472
+ file_id: string;
473
+ index: number;
474
+ };
475
+ } | {
476
+ type: "response.reasoning_summary_part.added";
477
+ item_id: string;
478
+ summary_index: number;
479
+ } | {
480
+ type: "response.reasoning_summary_text.delta";
481
+ item_id: string;
482
+ summary_index: number;
483
+ delta: string;
484
+ } | {
485
+ type: "response.reasoning_summary_part.done";
486
+ item_id: string;
487
+ summary_index: number;
488
+ } | {
489
+ type: "response.apply_patch_call_operation_diff.delta";
490
+ item_id: string;
491
+ output_index: number;
492
+ delta: string;
493
+ obfuscation?: string | null | undefined;
494
+ } | {
495
+ type: "response.apply_patch_call_operation_diff.done";
496
+ item_id: string;
497
+ output_index: number;
498
+ diff: string;
499
+ } | {
500
+ type: "error";
501
+ sequence_number: number;
502
+ error: {
503
+ type: string;
504
+ code: string;
505
+ message: string;
506
+ param?: string | null | undefined;
507
+ };
508
+ }>;
509
+
510
+ /**
511
+ * Type definitions for the apply_patch operations.
512
+ */
513
+ type ApplyPatchOperation = {
514
+ type: 'create_file';
515
+ /**
516
+ * Path of the file to create relative to the workspace root.
517
+ */
518
+ path: string;
519
+ /**
520
+ * Unified diff content to apply when creating the file.
521
+ */
522
+ diff: string;
523
+ } | {
524
+ type: 'delete_file';
525
+ /**
526
+ * Path of the file to delete relative to the workspace root.
527
+ */
528
+ path: string;
529
+ } | {
530
+ type: 'update_file';
531
+ /**
532
+ * Path of the file to update relative to the workspace root.
533
+ */
534
+ path: string;
535
+ /**
536
+ * Unified diff content to apply to the existing file.
537
+ */
538
+ diff: string;
539
+ };
13
540
 
14
541
  declare const openaiTools: {
15
- fileSearch: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
16
- query: string;
542
+ /**
543
+ * The apply_patch tool lets GPT-5.1 create, update, and delete files in your
544
+ * codebase using structured diffs. Instead of just suggesting edits, the model
545
+ * emits patch operations that your application applies and then reports back on,
546
+ * enabling iterative, multi-step code editing workflows.
547
+ *
548
+ */
549
+ applyPatch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
550
+ callId: string;
551
+ operation: ApplyPatchOperation;
552
+ }, {
553
+ status: "completed" | "failed";
554
+ output?: string;
555
+ }, {}>;
556
+ /**
557
+ * The Code Interpreter tool allows models to write and run Python code in a
558
+ * sandboxed environment to solve complex problems in domains like data analysis,
559
+ * coding, and math.
560
+ *
561
+ * @param container - The container to use for the code interpreter.
562
+ */
563
+ codeInterpreter: (args?: {
564
+ container?: string | {
565
+ fileIds?: string[];
566
+ };
567
+ }) => _ai_sdk_provider_utils.Tool<{
568
+ code?: string | null;
569
+ containerId: string;
17
570
  }, {
18
- vectorStoreIds?: string[];
571
+ outputs?: Array<{
572
+ type: "logs";
573
+ logs: string;
574
+ } | {
575
+ type: "image";
576
+ url: string;
577
+ }> | null;
578
+ }>;
579
+ /**
580
+ * File search is a tool available in the Responses API. It enables models to
581
+ * retrieve information in a knowledge base of previously uploaded files through
582
+ * semantic and keyword search.
583
+ *
584
+ * @param vectorStoreIds - The vector store IDs to use for the file search.
585
+ * @param maxNumResults - The maximum number of results to return.
586
+ * @param ranking - The ranking options to use for the file search.
587
+ * @param filters - The filters to use for the file search.
588
+ */
589
+ fileSearch: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
590
+ queries: string[];
591
+ results: null | {
592
+ attributes: Record<string, unknown>;
593
+ fileId: string;
594
+ filename: string;
595
+ score: number;
596
+ text: string;
597
+ }[];
598
+ }, {
599
+ vectorStoreIds: string[];
19
600
  maxNumResults?: number;
20
601
  ranking?: {
21
- ranker?: "auto" | "default-2024-08-21";
602
+ ranker?: string;
603
+ scoreThreshold?: number;
22
604
  };
23
- filters?: {
24
- key: string;
25
- type: "eq" | "ne" | "gt" | "gte" | "lt" | "lte";
26
- value: string | number | boolean;
27
- } | {
28
- type: "and" | "or";
29
- filters: any[];
605
+ filters?: OpenAIResponsesFileSearchToolComparisonFilter | OpenAIResponsesFileSearchToolCompoundFilter;
606
+ }>;
607
+ /**
608
+ * The image generation tool allows you to generate images using a text prompt,
609
+ * and optionally image inputs. It leverages the GPT Image model,
610
+ * and automatically optimizes text inputs for improved performance.
611
+ *
612
+ * @param background - Background type for the generated image. One of 'auto', 'opaque', or 'transparent'.
613
+ * @param inputFidelity - Input fidelity for the generated image. One of 'low' or 'high'.
614
+ * @param inputImageMask - Optional mask for inpainting. Contains fileId and/or imageUrl.
615
+ * @param model - The image generation model to use. Default: gpt-image-1.
616
+ * @param moderation - Moderation level for the generated image. Default: 'auto'.
617
+ * @param outputCompression - Compression level for the output image (0-100).
618
+ * @param outputFormat - The output format of the generated image. One of 'png', 'jpeg', or 'webp'.
619
+ * @param partialImages - Number of partial images to generate in streaming mode (0-3).
620
+ * @param quality - The quality of the generated image. One of 'auto', 'low', 'medium', or 'high'.
621
+ * @param size - The size of the generated image. One of 'auto', '1024x1024', '1024x1536', or '1536x1024'.
622
+ */
623
+ imageGeneration: (args?: {
624
+ background?: "auto" | "opaque" | "transparent";
625
+ inputFidelity?: "low" | "high";
626
+ inputImageMask?: {
627
+ fileId?: string;
628
+ imageUrl?: string;
30
629
  };
630
+ model?: string;
631
+ moderation?: "auto";
632
+ outputCompression?: number;
633
+ outputFormat?: "png" | "jpeg" | "webp";
634
+ partialImages?: number;
635
+ quality?: "auto" | "low" | "medium" | "high";
636
+ size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024";
637
+ }) => _ai_sdk_provider_utils.Tool<{}, {
638
+ result: string;
31
639
  }>;
32
- webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{}, {
640
+ /**
641
+ * Local shell is a tool that allows agents to run shell commands locally
642
+ * on a machine you or the user provides.
643
+ *
644
+ * Supported models: `gpt-5-codex` and `codex-mini-latest`
645
+ */
646
+ localShell: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
647
+ action: {
648
+ type: "exec";
649
+ command: string[];
650
+ timeoutMs?: number;
651
+ user?: string;
652
+ workingDirectory?: string;
653
+ env?: Record<string, string>;
654
+ };
655
+ }, {
656
+ output: string;
657
+ }, {}>;
658
+ /**
659
+ * The shell tool allows the model to interact with your local computer through
660
+ * a controlled command-line interface. The model proposes shell commands; your
661
+ * integration executes them and returns the outputs.
662
+ *
663
+ * Available through the Responses API for use with GPT-5.1.
664
+ *
665
+ * WARNING: Running arbitrary shell commands can be dangerous. Always sandbox
666
+ * execution or add strict allow-/deny-lists before forwarding a command to
667
+ * the system shell.
668
+ */
669
+ shell: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
670
+ action: {
671
+ commands: string[];
672
+ timeoutMs?: number;
673
+ maxOutputLength?: number;
674
+ };
675
+ }, {
676
+ output: Array<{
677
+ stdout: string;
678
+ stderr: string;
679
+ outcome: {
680
+ type: "timeout";
681
+ } | {
682
+ type: "exit";
683
+ exitCode: number;
684
+ };
685
+ }>;
686
+ }, {}>;
687
+ /**
688
+ * Web search allows models to access up-to-date information from the internet
689
+ * and provide answers with sourced citations.
690
+ *
691
+ * @param searchContextSize - The search context size to use for the web search.
692
+ * @param userLocation - The user location to use for the web search.
693
+ */
694
+ webSearchPreview: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
695
+ action: {
696
+ type: "search";
697
+ query?: string;
698
+ } | {
699
+ type: "openPage";
700
+ url?: string | null;
701
+ } | {
702
+ type: "findInPage";
703
+ url?: string | null;
704
+ pattern?: string | null;
705
+ };
706
+ }, {
33
707
  searchContextSize?: "low" | "medium" | "high";
34
708
  userLocation?: {
35
709
  type: "approximate";
@@ -39,110 +713,153 @@ declare const openaiTools: {
39
713
  timezone?: string;
40
714
  };
41
715
  }>;
716
+ /**
717
+ * Web search allows models to access up-to-date information from the internet
718
+ * and provide answers with sourced citations.
719
+ *
720
+ * @param filters - The filters to use for the web search.
721
+ * @param searchContextSize - The search context size to use for the web search.
722
+ * @param userLocation - The user location to use for the web search.
723
+ */
724
+ webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
725
+ action: {
726
+ type: "search";
727
+ query?: string;
728
+ } | {
729
+ type: "openPage";
730
+ url?: string | null;
731
+ } | {
732
+ type: "findInPage";
733
+ url?: string | null;
734
+ pattern?: string | null;
735
+ };
736
+ sources?: Array<{
737
+ type: "url";
738
+ url: string;
739
+ } | {
740
+ type: "api";
741
+ name: string;
742
+ }>;
743
+ }>;
744
+ /**
745
+ * MCP (Model Context Protocol) allows models to call tools exposed by
746
+ * remote MCP servers or service connectors.
747
+ *
748
+ * @param serverLabel - Label to identify the MCP server.
749
+ * @param allowedTools - Allowed tool names or filter object.
750
+ * @param authorization - OAuth access token for the MCP server/connector.
751
+ * @param connectorId - Identifier for a service connector.
752
+ * @param headers - Optional headers to include in MCP requests.
753
+ * // param requireApproval - Approval policy ('always'|'never'|filter object). (Removed - always 'never')
754
+ * @param serverDescription - Optional description of the server.
755
+ * @param serverUrl - URL for the MCP server.
756
+ */
757
+ mcp: (args: {
758
+ serverLabel: string;
759
+ allowedTools?: string[] | {
760
+ readOnly?: boolean;
761
+ toolNames?: string[];
762
+ };
763
+ authorization?: string;
764
+ connectorId?: string;
765
+ headers?: Record<string, string>;
766
+ requireApproval?: "always" | "never" | {
767
+ never?: {
768
+ toolNames?: string[];
769
+ };
770
+ };
771
+ serverDescription?: string;
772
+ serverUrl?: string;
773
+ }) => _ai_sdk_provider_utils.Tool<{}, {
774
+ type: "call";
775
+ serverLabel: string;
776
+ name: string;
777
+ arguments: string;
778
+ output?: string | null;
779
+ error?: _ai_sdk_provider.JSONValue;
780
+ }>;
42
781
  };
43
782
 
44
- type OpenAITranscriptionModelId = 'whisper-1' | 'gpt-4o-mini-transcribe' | 'gpt-4o-transcribe' | (string & {});
45
-
46
- type OpenAIConfig = {
47
- provider: string;
48
- url: (options: {
49
- modelId: string;
50
- path: string;
51
- }) => string;
52
- headers: () => Record<string, string | undefined>;
53
- fetch?: FetchFunction;
54
- generateId?: () => string;
55
- };
56
-
57
- declare const openaiResponsesModelIds: readonly ["gpt-4.1", "gpt-4.1-2025-04-14", "gpt-4.1-mini", "gpt-4.1-mini-2025-04-14", "gpt-4.1-nano", "gpt-4.1-nano-2025-04-14", "gpt-4o", "gpt-4o-2024-05-13", "gpt-4o-2024-08-06", "gpt-4o-2024-11-20", "gpt-4o-audio-preview", "gpt-4o-audio-preview-2024-10-01", "gpt-4o-audio-preview-2024-12-17", "gpt-4o-search-preview", "gpt-4o-search-preview-2025-03-11", "gpt-4o-mini-search-preview", "gpt-4o-mini-search-preview-2025-03-11", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-turbo-preview", "gpt-4-0125-preview", "gpt-4-1106-preview", "gpt-4", "gpt-4-0613", "gpt-4.5-preview", "gpt-4.5-preview-2025-02-27", "gpt-3.5-turbo-0125", "gpt-3.5-turbo", "gpt-3.5-turbo-1106", "chatgpt-4o-latest", "o1", "o1-2024-12-17", "o3-mini", "o3-mini-2025-01-31", "o3", "o3-2025-04-16", "o4-mini", "o4-mini-2025-04-16", "codex-mini-latest", "computer-use-preview", "gpt-5", "gpt-5-2025-08-07", "gpt-5-mini", "gpt-5-mini-2025-08-07", "gpt-5-nano", "gpt-5-nano-2025-08-07", "gpt-5-chat-latest"];
58
- type OpenAIResponsesModelId = (typeof openaiResponsesModelIds)[number] | (string & {});
59
-
60
- declare class OpenAIResponsesLanguageModel implements LanguageModelV2 {
61
- readonly specificationVersion = "v2";
62
- readonly modelId: OpenAIResponsesModelId;
63
- private readonly config;
64
- constructor(modelId: OpenAIResponsesModelId, config: OpenAIConfig);
65
- readonly supportedUrls: Record<string, RegExp[]>;
66
- get provider(): string;
67
- private getArgs;
68
- doGenerate(options: Parameters<LanguageModelV2['doGenerate']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doGenerate']>>>;
69
- doStream(options: Parameters<LanguageModelV2['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doStream']>>>;
70
- }
71
- declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
72
- metadata: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
73
- parallelToolCalls: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
74
- previousResponseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
75
- store: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
76
- user: z.ZodOptional<z.ZodNullable<z.ZodString>>;
77
- reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
- strictJsonSchema: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
79
- instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
80
- reasoningSummary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
81
- serviceTier: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
82
- auto: "auto";
83
- flex: "flex";
84
- priority: "priority";
85
- }>>>;
86
- include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
87
- "reasoning.encrypted_content": "reasoning.encrypted_content";
88
- "file_search_call.results": "file_search_call.results";
89
- }>>>>;
90
- textVerbosity: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
91
- low: "low";
92
- medium: "medium";
93
- high: "high";
94
- }>>>;
95
- }, z.core.$strip>;
96
- type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
783
+ type OpenAIResponsesModelId = 'chatgpt-4o-latest' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4-0613' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-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-4' | '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-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5.1-codex-max' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | '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' | (string & {});
784
+ declare const openaiResponsesProviderOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
785
+ conversation?: string | null | undefined;
786
+ include?: ("file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
787
+ instructions?: string | null | undefined;
788
+ logprobs?: number | boolean | undefined;
789
+ maxToolCalls?: number | null | undefined;
790
+ metadata?: any;
791
+ parallelToolCalls?: boolean | null | undefined;
792
+ previousResponseId?: string | null | undefined;
793
+ promptCacheKey?: string | null | undefined;
794
+ promptCacheRetention?: "in_memory" | "24h" | null | undefined;
795
+ reasoningEffort?: string | null | undefined;
796
+ reasoningSummary?: string | null | undefined;
797
+ safetyIdentifier?: string | null | undefined;
798
+ serviceTier?: "default" | "auto" | "flex" | "priority" | null | undefined;
799
+ store?: boolean | null | undefined;
800
+ strictJsonSchema?: boolean | null | undefined;
801
+ textVerbosity?: "low" | "medium" | "high" | null | undefined;
802
+ truncation?: "auto" | "disabled" | null | undefined;
803
+ user?: string | null | undefined;
804
+ systemMessageMode?: "remove" | "system" | "developer" | undefined;
805
+ forceReasoning?: boolean | undefined;
806
+ }>;
807
+ type OpenAIResponsesProviderOptions = InferSchema<typeof openaiResponsesProviderOptionsSchema>;
97
808
 
98
809
  type OpenAISpeechModelId = 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts' | (string & {});
99
810
 
100
- interface OpenAIProvider extends ProviderV2 {
101
- (modelId: OpenAIResponsesModelId): LanguageModelV2;
811
+ type OpenAITranscriptionModelId = 'whisper-1' | 'gpt-4o-mini-transcribe' | 'gpt-4o-transcribe' | (string & {});
812
+
813
+ interface OpenAIProvider extends ProviderV3 {
814
+ (modelId: OpenAIResponsesModelId): LanguageModelV3;
102
815
  /**
103
816
  Creates an OpenAI model for text generation.
104
817
  */
105
- languageModel(modelId: OpenAIResponsesModelId): OpenAIResponsesLanguageModel;
818
+ languageModel(modelId: OpenAIResponsesModelId): LanguageModelV3;
106
819
  /**
107
820
  Creates an OpenAI chat model for text generation.
108
821
  */
109
- chat(modelId: OpenAIChatModelId): LanguageModelV2;
822
+ chat(modelId: OpenAIChatModelId): LanguageModelV3;
110
823
  /**
111
824
  Creates an OpenAI responses API model for text generation.
112
825
  */
113
- responses(modelId: OpenAIResponsesModelId): LanguageModelV2;
826
+ responses(modelId: OpenAIResponsesModelId): LanguageModelV3;
114
827
  /**
115
828
  Creates an OpenAI completion model for text generation.
116
829
  */
117
- completion(modelId: OpenAICompletionModelId): LanguageModelV2;
830
+ completion(modelId: OpenAICompletionModelId): LanguageModelV3;
118
831
  /**
119
832
  Creates a model for text embeddings.
120
833
  */
121
- embedding(modelId: OpenAIEmbeddingModelId): EmbeddingModelV2<string>;
834
+ embedding(modelId: OpenAIEmbeddingModelId): EmbeddingModelV3;
122
835
  /**
123
836
  Creates a model for text embeddings.
124
837
  */
125
- textEmbedding(modelId: OpenAIEmbeddingModelId): EmbeddingModelV2<string>;
838
+ embeddingModel(modelId: OpenAIEmbeddingModelId): EmbeddingModelV3;
126
839
  /**
127
- Creates a model for text embeddings.
840
+ * @deprecated Use `embedding` instead.
841
+ */
842
+ textEmbedding(modelId: OpenAIEmbeddingModelId): EmbeddingModelV3;
843
+ /**
844
+ * @deprecated Use `embeddingModel` instead.
128
845
  */
129
- textEmbeddingModel(modelId: OpenAIEmbeddingModelId): EmbeddingModelV2<string>;
846
+ textEmbeddingModel(modelId: OpenAIEmbeddingModelId): EmbeddingModelV3;
130
847
  /**
131
848
  Creates a model for image generation.
132
849
  */
133
- image(modelId: OpenAIImageModelId): ImageModelV2;
850
+ image(modelId: OpenAIImageModelId): ImageModelV3;
134
851
  /**
135
852
  Creates a model for image generation.
136
853
  */
137
- imageModel(modelId: OpenAIImageModelId): ImageModelV2;
854
+ imageModel(modelId: OpenAIImageModelId): ImageModelV3;
138
855
  /**
139
856
  Creates a model for transcription.
140
857
  */
141
- transcription(modelId: OpenAITranscriptionModelId): TranscriptionModelV2;
858
+ transcription(modelId: OpenAITranscriptionModelId): TranscriptionModelV3;
142
859
  /**
143
860
  Creates a model for speech generation.
144
861
  */
145
- speech(modelId: OpenAISpeechModelId): SpeechModelV2;
862
+ speech(modelId: OpenAISpeechModelId): SpeechModelV3;
146
863
  /**
147
864
  OpenAI-specific tools.
148
865
  */
@@ -188,4 +905,34 @@ Default OpenAI provider instance.
188
905
  */
189
906
  declare const openai: OpenAIProvider;
190
907
 
191
- export { type OpenAIProvider, type OpenAIProviderSettings, type OpenAIResponsesProviderOptions, createOpenAI, openai };
908
+ type OpenaiResponsesChunk = InferSchema<typeof openaiResponsesChunkSchema>;
909
+ type ResponsesOutputTextAnnotationProviderMetadata = Extract<OpenaiResponsesChunk, {
910
+ type: 'response.output_text.annotation.added';
911
+ }>['annotation'];
912
+ type ResponsesTextProviderMetadata = {
913
+ itemId: string;
914
+ annotations?: Array<ResponsesOutputTextAnnotationProviderMetadata>;
915
+ };
916
+ type OpenaiResponsesTextProviderMetadata = {
917
+ openai: ResponsesTextProviderMetadata;
918
+ };
919
+ type ResponsesSourceDocumentProviderMetadata = {
920
+ type: 'file_citation';
921
+ fileId: string;
922
+ index: number;
923
+ } | {
924
+ type: 'container_file_citation';
925
+ fileId: string;
926
+ containerId: string;
927
+ } | {
928
+ type: 'file_path';
929
+ fileId: string;
930
+ index: number;
931
+ };
932
+ type OpenaiResponsesSourceDocumentProviderMetadata = {
933
+ openai: ResponsesSourceDocumentProviderMetadata;
934
+ };
935
+
936
+ declare const VERSION: string;
937
+
938
+ export { type OpenAIChatLanguageModelOptions, type OpenAIProvider, type OpenAIProviderSettings, type OpenAIResponsesProviderOptions, type OpenaiResponsesSourceDocumentProviderMetadata, type OpenaiResponsesTextProviderMetadata, VERSION, createOpenAI, openai };