@ai-sdk/openai 2.1.0-beta.9 → 3.0.0-beta.17
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 +67 -0
- package/dist/index.d.mts +16 -10
- package/dist/index.d.ts +16 -10
- package/dist/index.js +61 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -19
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +115 -11
- package/dist/internal/index.d.ts +115 -11
- package/dist/internal/index.js +59 -13
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +56 -13
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,72 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.17
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dee8b05: ai SDK 6 beta
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [dee8b05]
|
|
12
|
+
- @ai-sdk/provider@3.0.0-beta.6
|
|
13
|
+
- @ai-sdk/provider-utils@4.0.0-beta.10
|
|
14
|
+
|
|
15
|
+
## 2.1.0-beta.16
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [521c537]
|
|
20
|
+
- @ai-sdk/provider-utils@3.1.0-beta.9
|
|
21
|
+
|
|
22
|
+
## 2.1.0-beta.15
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [e06565c]
|
|
27
|
+
- @ai-sdk/provider-utils@3.1.0-beta.8
|
|
28
|
+
|
|
29
|
+
## 2.1.0-beta.14
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- 000e87b: fix(provider/openai): add providerExecuted flag to tool start chunks
|
|
34
|
+
|
|
35
|
+
## 2.1.0-beta.13
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- 357cfd7: feat(provider/openai): add new model IDs `gpt-image-1-mini`, `gpt-5-pro`, `gpt-5-pro-2025-10-06`
|
|
40
|
+
|
|
41
|
+
## 2.1.0-beta.12
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- 046aa3b: feat(provider): speech model v3 spec
|
|
46
|
+
- e8109d3: feat: tool execution approval
|
|
47
|
+
- 21e20c0: feat(provider): transcription model v3 spec
|
|
48
|
+
- Updated dependencies [046aa3b]
|
|
49
|
+
- Updated dependencies [e8109d3]
|
|
50
|
+
- @ai-sdk/provider@2.1.0-beta.5
|
|
51
|
+
- @ai-sdk/provider-utils@3.1.0-beta.7
|
|
52
|
+
|
|
53
|
+
## 2.1.0-beta.11
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- 0adc679: feat(provider): shared spec v3
|
|
58
|
+
- 2b0caef: feat(provider/openai): preview image generation results
|
|
59
|
+
- Updated dependencies [0adc679]
|
|
60
|
+
- Updated dependencies [2b0caef]
|
|
61
|
+
- @ai-sdk/provider-utils@3.1.0-beta.6
|
|
62
|
+
- @ai-sdk/provider@2.1.0-beta.4
|
|
63
|
+
|
|
64
|
+
## 2.1.0-beta.10
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- d64ece9: enables image_generation capabilities in the Azure provider through the Responses API.
|
|
69
|
+
|
|
3
70
|
## 2.1.0-beta.9
|
|
4
71
|
|
|
5
72
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3,
|
|
1
|
+
import { ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
|
|
2
2
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
3
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
4
|
import { z } from 'zod/v4';
|
|
@@ -40,7 +40,7 @@ type OpenAICompletionModelId = 'gpt-3.5-turbo-instruct' | (string & {});
|
|
|
40
40
|
|
|
41
41
|
type OpenAIEmbeddingModelId = 'text-embedding-3-small' | 'text-embedding-3-large' | 'text-embedding-ada-002' | (string & {});
|
|
42
42
|
|
|
43
|
-
type OpenAIImageModelId = '
|
|
43
|
+
type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | (string & {});
|
|
44
44
|
|
|
45
45
|
declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{}, {
|
|
46
46
|
/**
|
|
@@ -182,11 +182,16 @@ declare const openaiTools: {
|
|
|
182
182
|
*
|
|
183
183
|
* Must have name `image_generation`.
|
|
184
184
|
*
|
|
185
|
-
* @param
|
|
186
|
-
* @param
|
|
187
|
-
* @param
|
|
188
|
-
* @param
|
|
189
|
-
* @param
|
|
185
|
+
* @param background - Background type for the generated image. One of 'auto', 'opaque', or 'transparent'.
|
|
186
|
+
* @param inputFidelity - Input fidelity for the generated image. One of 'low' or 'high'.
|
|
187
|
+
* @param inputImageMask - Optional mask for inpainting. Contains fileId and/or imageUrl.
|
|
188
|
+
* @param model - The image generation model to use. Default: gpt-image-1.
|
|
189
|
+
* @param moderation - Moderation level for the generated image. Default: 'auto'.
|
|
190
|
+
* @param outputCompression - Compression level for the output image (0-100).
|
|
191
|
+
* @param outputFormat - The output format of the generated image. One of 'png', 'jpeg', or 'webp'.
|
|
192
|
+
* @param partialImages - Number of partial images to generate in streaming mode (0-3).
|
|
193
|
+
* @param quality - The quality of the generated image. One of 'auto', 'low', 'medium', or 'high'.
|
|
194
|
+
* @param size - The size of the generated image. One of 'auto', '1024x1024', '1024x1536', or '1536x1024'.
|
|
190
195
|
*/
|
|
191
196
|
imageGeneration: (args?: {
|
|
192
197
|
background?: "auto" | "opaque" | "transparent";
|
|
@@ -199,6 +204,7 @@ declare const openaiTools: {
|
|
|
199
204
|
moderation?: "auto";
|
|
200
205
|
outputCompression?: number;
|
|
201
206
|
outputFormat?: "png" | "jpeg" | "webp";
|
|
207
|
+
partialImages?: number;
|
|
202
208
|
quality?: "auto" | "low" | "medium" | "high";
|
|
203
209
|
size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024";
|
|
204
210
|
}) => _ai_sdk_provider_utils.Tool<{}, {
|
|
@@ -258,7 +264,7 @@ declare const openaiTools: {
|
|
|
258
264
|
webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, unknown>;
|
|
259
265
|
};
|
|
260
266
|
|
|
261
|
-
type OpenAIResponsesModelId = '
|
|
267
|
+
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-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 & {});
|
|
262
268
|
|
|
263
269
|
type OpenAISpeechModelId = 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts' | (string & {});
|
|
264
270
|
|
|
@@ -305,11 +311,11 @@ interface OpenAIProvider extends ProviderV3 {
|
|
|
305
311
|
/**
|
|
306
312
|
Creates a model for transcription.
|
|
307
313
|
*/
|
|
308
|
-
transcription(modelId: OpenAITranscriptionModelId):
|
|
314
|
+
transcription(modelId: OpenAITranscriptionModelId): TranscriptionModelV3;
|
|
309
315
|
/**
|
|
310
316
|
Creates a model for speech generation.
|
|
311
317
|
*/
|
|
312
|
-
speech(modelId: OpenAISpeechModelId):
|
|
318
|
+
speech(modelId: OpenAISpeechModelId): SpeechModelV3;
|
|
313
319
|
/**
|
|
314
320
|
OpenAI-specific tools.
|
|
315
321
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3,
|
|
1
|
+
import { ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, TranscriptionModelV3, SpeechModelV3 } from '@ai-sdk/provider';
|
|
2
2
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
3
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
4
|
import { z } from 'zod/v4';
|
|
@@ -40,7 +40,7 @@ type OpenAICompletionModelId = 'gpt-3.5-turbo-instruct' | (string & {});
|
|
|
40
40
|
|
|
41
41
|
type OpenAIEmbeddingModelId = 'text-embedding-3-small' | 'text-embedding-3-large' | 'text-embedding-ada-002' | (string & {});
|
|
42
42
|
|
|
43
|
-
type OpenAIImageModelId = '
|
|
43
|
+
type OpenAIImageModelId = 'dall-e-3' | 'dall-e-2' | 'gpt-image-1' | 'gpt-image-1-mini' | (string & {});
|
|
44
44
|
|
|
45
45
|
declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{}, {
|
|
46
46
|
/**
|
|
@@ -182,11 +182,16 @@ declare const openaiTools: {
|
|
|
182
182
|
*
|
|
183
183
|
* Must have name `image_generation`.
|
|
184
184
|
*
|
|
185
|
-
* @param
|
|
186
|
-
* @param
|
|
187
|
-
* @param
|
|
188
|
-
* @param
|
|
189
|
-
* @param
|
|
185
|
+
* @param background - Background type for the generated image. One of 'auto', 'opaque', or 'transparent'.
|
|
186
|
+
* @param inputFidelity - Input fidelity for the generated image. One of 'low' or 'high'.
|
|
187
|
+
* @param inputImageMask - Optional mask for inpainting. Contains fileId and/or imageUrl.
|
|
188
|
+
* @param model - The image generation model to use. Default: gpt-image-1.
|
|
189
|
+
* @param moderation - Moderation level for the generated image. Default: 'auto'.
|
|
190
|
+
* @param outputCompression - Compression level for the output image (0-100).
|
|
191
|
+
* @param outputFormat - The output format of the generated image. One of 'png', 'jpeg', or 'webp'.
|
|
192
|
+
* @param partialImages - Number of partial images to generate in streaming mode (0-3).
|
|
193
|
+
* @param quality - The quality of the generated image. One of 'auto', 'low', 'medium', or 'high'.
|
|
194
|
+
* @param size - The size of the generated image. One of 'auto', '1024x1024', '1024x1536', or '1536x1024'.
|
|
190
195
|
*/
|
|
191
196
|
imageGeneration: (args?: {
|
|
192
197
|
background?: "auto" | "opaque" | "transparent";
|
|
@@ -199,6 +204,7 @@ declare const openaiTools: {
|
|
|
199
204
|
moderation?: "auto";
|
|
200
205
|
outputCompression?: number;
|
|
201
206
|
outputFormat?: "png" | "jpeg" | "webp";
|
|
207
|
+
partialImages?: number;
|
|
202
208
|
quality?: "auto" | "low" | "medium" | "high";
|
|
203
209
|
size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024";
|
|
204
210
|
}) => _ai_sdk_provider_utils.Tool<{}, {
|
|
@@ -258,7 +264,7 @@ declare const openaiTools: {
|
|
|
258
264
|
webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, unknown>;
|
|
259
265
|
};
|
|
260
266
|
|
|
261
|
-
type OpenAIResponsesModelId = '
|
|
267
|
+
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-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 & {});
|
|
262
268
|
|
|
263
269
|
type OpenAISpeechModelId = 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts' | (string & {});
|
|
264
270
|
|
|
@@ -305,11 +311,11 @@ interface OpenAIProvider extends ProviderV3 {
|
|
|
305
311
|
/**
|
|
306
312
|
Creates a model for transcription.
|
|
307
313
|
*/
|
|
308
|
-
transcription(modelId: OpenAITranscriptionModelId):
|
|
314
|
+
transcription(modelId: OpenAITranscriptionModelId): TranscriptionModelV3;
|
|
309
315
|
/**
|
|
310
316
|
Creates a model for speech generation.
|
|
311
317
|
*/
|
|
312
|
-
speech(modelId: OpenAISpeechModelId):
|
|
318
|
+
speech(modelId: OpenAISpeechModelId): SpeechModelV3;
|
|
313
319
|
/**
|
|
314
320
|
OpenAI-specific tools.
|
|
315
321
|
*/
|
package/dist/index.js
CHANGED
|
@@ -60,6 +60,7 @@ function convertToOpenAIChatMessages({
|
|
|
60
60
|
prompt,
|
|
61
61
|
systemMessageMode = "system"
|
|
62
62
|
}) {
|
|
63
|
+
var _a;
|
|
63
64
|
const messages = [];
|
|
64
65
|
const warnings = [];
|
|
65
66
|
for (const { role, content } of prompt) {
|
|
@@ -98,7 +99,7 @@ function convertToOpenAIChatMessages({
|
|
|
98
99
|
messages.push({
|
|
99
100
|
role: "user",
|
|
100
101
|
content: content.map((part, index) => {
|
|
101
|
-
var
|
|
102
|
+
var _a2, _b, _c;
|
|
102
103
|
switch (part.type) {
|
|
103
104
|
case "text": {
|
|
104
105
|
return { type: "text", text: part.text };
|
|
@@ -111,7 +112,7 @@ function convertToOpenAIChatMessages({
|
|
|
111
112
|
image_url: {
|
|
112
113
|
url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${(0, import_provider_utils2.convertToBase64)(part.data)}`,
|
|
113
114
|
// OpenAI specific extension: image detail
|
|
114
|
-
detail: (_b = (
|
|
115
|
+
detail: (_b = (_a2 = part.providerOptions) == null ? void 0 : _a2.openai) == null ? void 0 : _b.imageDetail
|
|
115
116
|
}
|
|
116
117
|
};
|
|
117
118
|
} else if (part.mediaType.startsWith("audio/")) {
|
|
@@ -208,6 +209,9 @@ function convertToOpenAIChatMessages({
|
|
|
208
209
|
case "error-text":
|
|
209
210
|
contentValue = output.value;
|
|
210
211
|
break;
|
|
212
|
+
case "execution-denied":
|
|
213
|
+
contentValue = (_a = output.reason) != null ? _a : "Tool execution denied.";
|
|
214
|
+
break;
|
|
211
215
|
case "content":
|
|
212
216
|
case "json":
|
|
213
217
|
case "error-json":
|
|
@@ -1590,9 +1594,13 @@ var import_v48 = require("zod/v4");
|
|
|
1590
1594
|
var modelMaxImagesPerCall = {
|
|
1591
1595
|
"dall-e-3": 1,
|
|
1592
1596
|
"dall-e-2": 10,
|
|
1593
|
-
"gpt-image-1": 10
|
|
1597
|
+
"gpt-image-1": 10,
|
|
1598
|
+
"gpt-image-1-mini": 10
|
|
1594
1599
|
};
|
|
1595
|
-
var hasDefaultResponseFormat = /* @__PURE__ */ new Set([
|
|
1600
|
+
var hasDefaultResponseFormat = /* @__PURE__ */ new Set([
|
|
1601
|
+
"gpt-image-1",
|
|
1602
|
+
"gpt-image-1-mini"
|
|
1603
|
+
]);
|
|
1596
1604
|
|
|
1597
1605
|
// src/image/openai-image-model.ts
|
|
1598
1606
|
var OpenAIImageModel = class {
|
|
@@ -1767,6 +1775,7 @@ var imageGenerationArgsSchema = import_v411.z.object({
|
|
|
1767
1775
|
moderation: import_v411.z.enum(["auto"]).optional(),
|
|
1768
1776
|
outputCompression: import_v411.z.number().int().min(0).max(100).optional(),
|
|
1769
1777
|
outputFormat: import_v411.z.enum(["png", "jpeg", "webp"]).optional(),
|
|
1778
|
+
partialImages: import_v411.z.number().int().min(0).max(3).optional(),
|
|
1770
1779
|
quality: import_v411.z.enum(["auto", "low", "medium", "high"]).optional(),
|
|
1771
1780
|
size: import_v411.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
|
|
1772
1781
|
}).strict();
|
|
@@ -1938,11 +1947,16 @@ var openaiTools = {
|
|
|
1938
1947
|
*
|
|
1939
1948
|
* Must have name `image_generation`.
|
|
1940
1949
|
*
|
|
1941
|
-
* @param
|
|
1942
|
-
* @param
|
|
1943
|
-
* @param
|
|
1944
|
-
* @param
|
|
1945
|
-
* @param
|
|
1950
|
+
* @param background - Background type for the generated image. One of 'auto', 'opaque', or 'transparent'.
|
|
1951
|
+
* @param inputFidelity - Input fidelity for the generated image. One of 'low' or 'high'.
|
|
1952
|
+
* @param inputImageMask - Optional mask for inpainting. Contains fileId and/or imageUrl.
|
|
1953
|
+
* @param model - The image generation model to use. Default: gpt-image-1.
|
|
1954
|
+
* @param moderation - Moderation level for the generated image. Default: 'auto'.
|
|
1955
|
+
* @param outputCompression - Compression level for the output image (0-100).
|
|
1956
|
+
* @param outputFormat - The output format of the generated image. One of 'png', 'jpeg', or 'webp'.
|
|
1957
|
+
* @param partialImages - Number of partial images to generate in streaming mode (0-3).
|
|
1958
|
+
* @param quality - The quality of the generated image. One of 'auto', 'low', 'medium', or 'high'.
|
|
1959
|
+
* @param size - The size of the generated image. One of 'auto', '1024x1024', '1024x1536', or '1536x1024'.
|
|
1946
1960
|
*/
|
|
1947
1961
|
imageGeneration,
|
|
1948
1962
|
/**
|
|
@@ -1999,7 +2013,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
1999
2013
|
store,
|
|
2000
2014
|
hasLocalShellTool = false
|
|
2001
2015
|
}) {
|
|
2002
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
2016
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
2003
2017
|
const input = [];
|
|
2004
2018
|
const warnings = [];
|
|
2005
2019
|
for (const { role, content } of prompt) {
|
|
@@ -2202,6 +2216,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
2202
2216
|
case "error-text":
|
|
2203
2217
|
contentValue = output.value;
|
|
2204
2218
|
break;
|
|
2219
|
+
case "execution-denied":
|
|
2220
|
+
contentValue = (_j = output.reason) != null ? _j : "Tool execution denied.";
|
|
2221
|
+
break;
|
|
2205
2222
|
case "content":
|
|
2206
2223
|
case "json":
|
|
2207
2224
|
case "error-json":
|
|
@@ -2331,11 +2348,12 @@ function prepareResponsesTools({
|
|
|
2331
2348
|
image_url: args.inputImageMask.imageUrl
|
|
2332
2349
|
} : void 0,
|
|
2333
2350
|
model: args.model,
|
|
2334
|
-
size: args.size,
|
|
2335
|
-
quality: args.quality,
|
|
2336
2351
|
moderation: args.moderation,
|
|
2352
|
+
partial_images: args.partialImages,
|
|
2353
|
+
quality: args.quality,
|
|
2354
|
+
output_compression: args.outputCompression,
|
|
2337
2355
|
output_format: args.outputFormat,
|
|
2338
|
-
|
|
2356
|
+
size: args.size
|
|
2339
2357
|
});
|
|
2340
2358
|
break;
|
|
2341
2359
|
}
|
|
@@ -3071,7 +3089,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3071
3089
|
controller.enqueue({
|
|
3072
3090
|
type: "tool-input-start",
|
|
3073
3091
|
id: value.item.id,
|
|
3074
|
-
toolName: webSearchToolName != null ? webSearchToolName : "web_search"
|
|
3092
|
+
toolName: webSearchToolName != null ? webSearchToolName : "web_search",
|
|
3093
|
+
providerExecuted: true
|
|
3075
3094
|
});
|
|
3076
3095
|
} else if (value.item.type === "computer_call") {
|
|
3077
3096
|
ongoingToolCalls[value.output_index] = {
|
|
@@ -3081,7 +3100,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3081
3100
|
controller.enqueue({
|
|
3082
3101
|
type: "tool-input-start",
|
|
3083
3102
|
id: value.item.id,
|
|
3084
|
-
toolName: "computer_use"
|
|
3103
|
+
toolName: "computer_use",
|
|
3104
|
+
providerExecuted: true
|
|
3085
3105
|
});
|
|
3086
3106
|
} else if (value.item.type === "code_interpreter_call") {
|
|
3087
3107
|
ongoingToolCalls[value.output_index] = {
|
|
@@ -3094,7 +3114,8 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3094
3114
|
controller.enqueue({
|
|
3095
3115
|
type: "tool-input-start",
|
|
3096
3116
|
id: value.item.id,
|
|
3097
|
-
toolName: "code_interpreter"
|
|
3117
|
+
toolName: "code_interpreter",
|
|
3118
|
+
providerExecuted: true
|
|
3098
3119
|
});
|
|
3099
3120
|
controller.enqueue({
|
|
3100
3121
|
type: "tool-input-delta",
|
|
@@ -3294,6 +3315,17 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3294
3315
|
delta: value.delta
|
|
3295
3316
|
});
|
|
3296
3317
|
}
|
|
3318
|
+
} else if (isResponseImageGenerationCallPartialImageChunk(value)) {
|
|
3319
|
+
controller.enqueue({
|
|
3320
|
+
type: "tool-result",
|
|
3321
|
+
toolCallId: value.item_id,
|
|
3322
|
+
toolName: "image_generation",
|
|
3323
|
+
result: {
|
|
3324
|
+
result: value.partial_image_b64
|
|
3325
|
+
},
|
|
3326
|
+
providerExecuted: true,
|
|
3327
|
+
preliminary: true
|
|
3328
|
+
});
|
|
3297
3329
|
} else if (isResponseCodeInterpreterCallCodeDeltaChunk(value)) {
|
|
3298
3330
|
const toolCall = ongoingToolCalls[value.output_index];
|
|
3299
3331
|
if (toolCall != null) {
|
|
@@ -3566,6 +3598,12 @@ var responseFunctionCallArgumentsDeltaSchema = import_v416.z.object({
|
|
|
3566
3598
|
output_index: import_v416.z.number(),
|
|
3567
3599
|
delta: import_v416.z.string()
|
|
3568
3600
|
});
|
|
3601
|
+
var responseImageGenerationCallPartialImageSchema = import_v416.z.object({
|
|
3602
|
+
type: import_v416.z.literal("response.image_generation_call.partial_image"),
|
|
3603
|
+
item_id: import_v416.z.string(),
|
|
3604
|
+
output_index: import_v416.z.number(),
|
|
3605
|
+
partial_image_b64: import_v416.z.string()
|
|
3606
|
+
});
|
|
3569
3607
|
var responseCodeInterpreterCallCodeDeltaSchema = import_v416.z.object({
|
|
3570
3608
|
type: import_v416.z.literal("response.code_interpreter_call_code.delta"),
|
|
3571
3609
|
item_id: import_v416.z.string(),
|
|
@@ -3615,6 +3653,7 @@ var openaiResponsesChunkSchema = import_v416.z.union([
|
|
|
3615
3653
|
responseOutputItemAddedSchema,
|
|
3616
3654
|
responseOutputItemDoneSchema,
|
|
3617
3655
|
responseFunctionCallArgumentsDeltaSchema,
|
|
3656
|
+
responseImageGenerationCallPartialImageSchema,
|
|
3618
3657
|
responseCodeInterpreterCallCodeDeltaSchema,
|
|
3619
3658
|
responseCodeInterpreterCallCodeDoneSchema,
|
|
3620
3659
|
responseAnnotationAddedSchema,
|
|
@@ -3642,6 +3681,9 @@ function isResponseCreatedChunk(chunk) {
|
|
|
3642
3681
|
function isResponseFunctionCallArgumentsDeltaChunk(chunk) {
|
|
3643
3682
|
return chunk.type === "response.function_call_arguments.delta";
|
|
3644
3683
|
}
|
|
3684
|
+
function isResponseImageGenerationCallPartialImageChunk(chunk) {
|
|
3685
|
+
return chunk.type === "response.image_generation_call.partial_image";
|
|
3686
|
+
}
|
|
3645
3687
|
function isResponseCodeInterpreterCallCodeDeltaChunk(chunk) {
|
|
3646
3688
|
return chunk.type === "response.code_interpreter_call_code.delta";
|
|
3647
3689
|
}
|
|
@@ -3753,7 +3795,7 @@ var OpenAISpeechModel = class {
|
|
|
3753
3795
|
constructor(modelId, config) {
|
|
3754
3796
|
this.modelId = modelId;
|
|
3755
3797
|
this.config = config;
|
|
3756
|
-
this.specificationVersion = "
|
|
3798
|
+
this.specificationVersion = "v3";
|
|
3757
3799
|
}
|
|
3758
3800
|
get provider() {
|
|
3759
3801
|
return this.config.provider;
|
|
@@ -3944,7 +3986,7 @@ var OpenAITranscriptionModel = class {
|
|
|
3944
3986
|
constructor(modelId, config) {
|
|
3945
3987
|
this.modelId = modelId;
|
|
3946
3988
|
this.config = config;
|
|
3947
|
-
this.specificationVersion = "
|
|
3989
|
+
this.specificationVersion = "v3";
|
|
3948
3990
|
}
|
|
3949
3991
|
get provider() {
|
|
3950
3992
|
return this.config.provider;
|
|
@@ -4074,7 +4116,7 @@ var openaiTranscriptionResponseSchema = import_v419.z.object({
|
|
|
4074
4116
|
});
|
|
4075
4117
|
|
|
4076
4118
|
// src/version.ts
|
|
4077
|
-
var VERSION = true ? "
|
|
4119
|
+
var VERSION = true ? "3.0.0-beta.17" : "0.0.0-test";
|
|
4078
4120
|
|
|
4079
4121
|
// src/openai-provider.ts
|
|
4080
4122
|
function createOpenAI(options = {}) {
|