@ai-sdk/openai 2.0.46 → 2.0.48
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 +13 -0
- package/dist/index.js +673 -665
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -22
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +672 -664
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +39 -21
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "@ai-sdk/provider-utils";
|
|
14
14
|
|
|
15
15
|
// src/openai-error.ts
|
|
16
|
-
import
|
|
16
|
+
import { z } from "zod/v4";
|
|
17
17
|
import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
|
|
18
18
|
var openaiErrorDataSchema = z.object({
|
|
19
19
|
error: z.object({
|
|
@@ -246,7 +246,7 @@ import {
|
|
|
246
246
|
lazyValidator,
|
|
247
247
|
zodSchema
|
|
248
248
|
} from "@ai-sdk/provider-utils";
|
|
249
|
-
import
|
|
249
|
+
import { z as z2 } from "zod/v4";
|
|
250
250
|
var openaiChatResponseSchema = lazyValidator(
|
|
251
251
|
() => zodSchema(
|
|
252
252
|
z2.object({
|
|
@@ -387,7 +387,7 @@ import {
|
|
|
387
387
|
lazyValidator as lazyValidator2,
|
|
388
388
|
zodSchema as zodSchema2
|
|
389
389
|
} from "@ai-sdk/provider-utils";
|
|
390
|
-
import
|
|
390
|
+
import { z as z3 } from "zod/v4";
|
|
391
391
|
var openaiChatLanguageModelOptions = lazyValidator2(
|
|
392
392
|
() => zodSchema2(
|
|
393
393
|
z3.object({
|
|
@@ -1205,7 +1205,7 @@ function mapOpenAIFinishReason2(finishReason) {
|
|
|
1205
1205
|
}
|
|
1206
1206
|
|
|
1207
1207
|
// src/completion/openai-completion-api.ts
|
|
1208
|
-
import
|
|
1208
|
+
import { z as z4 } from "zod/v4";
|
|
1209
1209
|
import {
|
|
1210
1210
|
lazyValidator as lazyValidator3,
|
|
1211
1211
|
zodSchema as zodSchema3
|
|
@@ -1270,7 +1270,7 @@ import {
|
|
|
1270
1270
|
lazyValidator as lazyValidator4,
|
|
1271
1271
|
zodSchema as zodSchema4
|
|
1272
1272
|
} from "@ai-sdk/provider-utils";
|
|
1273
|
-
import
|
|
1273
|
+
import { z as z5 } from "zod/v4";
|
|
1274
1274
|
var openaiCompletionProviderOptions = lazyValidator4(
|
|
1275
1275
|
() => zodSchema4(
|
|
1276
1276
|
z5.object({
|
|
@@ -1562,7 +1562,7 @@ import {
|
|
|
1562
1562
|
lazyValidator as lazyValidator5,
|
|
1563
1563
|
zodSchema as zodSchema5
|
|
1564
1564
|
} from "@ai-sdk/provider-utils";
|
|
1565
|
-
import
|
|
1565
|
+
import { z as z6 } from "zod/v4";
|
|
1566
1566
|
var openaiEmbeddingProviderOptions = lazyValidator5(
|
|
1567
1567
|
() => zodSchema5(
|
|
1568
1568
|
z6.object({
|
|
@@ -1582,7 +1582,7 @@ var openaiEmbeddingProviderOptions = lazyValidator5(
|
|
|
1582
1582
|
|
|
1583
1583
|
// src/embedding/openai-embedding-api.ts
|
|
1584
1584
|
import { lazyValidator as lazyValidator6, zodSchema as zodSchema6 } from "@ai-sdk/provider-utils";
|
|
1585
|
-
import
|
|
1585
|
+
import { z as z7 } from "zod/v4";
|
|
1586
1586
|
var openaiTextEmbeddingResponseSchema = lazyValidator6(
|
|
1587
1587
|
() => zodSchema6(
|
|
1588
1588
|
z7.object({
|
|
@@ -1665,7 +1665,7 @@ import {
|
|
|
1665
1665
|
|
|
1666
1666
|
// src/image/openai-image-api.ts
|
|
1667
1667
|
import { lazyValidator as lazyValidator7, zodSchema as zodSchema7 } from "@ai-sdk/provider-utils";
|
|
1668
|
-
import
|
|
1668
|
+
import { z as z8 } from "zod/v4";
|
|
1669
1669
|
var openaiImageResponseSchema = lazyValidator7(
|
|
1670
1670
|
() => zodSchema7(
|
|
1671
1671
|
z8.object({
|
|
@@ -1782,7 +1782,7 @@ import {
|
|
|
1782
1782
|
|
|
1783
1783
|
// src/transcription/openai-transcription-api.ts
|
|
1784
1784
|
import { lazyValidator as lazyValidator8, zodSchema as zodSchema8 } from "@ai-sdk/provider-utils";
|
|
1785
|
-
import
|
|
1785
|
+
import { z as z9 } from "zod/v4";
|
|
1786
1786
|
var openaiTranscriptionResponseSchema = lazyValidator8(
|
|
1787
1787
|
() => zodSchema8(
|
|
1788
1788
|
z9.object({
|
|
@@ -1819,7 +1819,7 @@ import {
|
|
|
1819
1819
|
lazyValidator as lazyValidator9,
|
|
1820
1820
|
zodSchema as zodSchema9
|
|
1821
1821
|
} from "@ai-sdk/provider-utils";
|
|
1822
|
-
import
|
|
1822
|
+
import { z as z10 } from "zod/v4";
|
|
1823
1823
|
var openAITranscriptionProviderOptions = lazyValidator9(
|
|
1824
1824
|
() => zodSchema9(
|
|
1825
1825
|
z10.object({
|
|
@@ -2029,7 +2029,7 @@ import {
|
|
|
2029
2029
|
lazyValidator as lazyValidator10,
|
|
2030
2030
|
zodSchema as zodSchema10
|
|
2031
2031
|
} from "@ai-sdk/provider-utils";
|
|
2032
|
-
import
|
|
2032
|
+
import { z as z11 } from "zod/v4";
|
|
2033
2033
|
var openaiSpeechProviderOptionsSchema = lazyValidator10(
|
|
2034
2034
|
() => zodSchema10(
|
|
2035
2035
|
z11.object({
|
|
@@ -2162,7 +2162,7 @@ import {
|
|
|
2162
2162
|
parseProviderOptions as parseProviderOptions6,
|
|
2163
2163
|
validateTypes
|
|
2164
2164
|
} from "@ai-sdk/provider-utils";
|
|
2165
|
-
import
|
|
2165
|
+
import { z as z13 } from "zod/v4";
|
|
2166
2166
|
|
|
2167
2167
|
// src/tool/local-shell.ts
|
|
2168
2168
|
import {
|
|
@@ -2170,7 +2170,7 @@ import {
|
|
|
2170
2170
|
lazySchema,
|
|
2171
2171
|
zodSchema as zodSchema11
|
|
2172
2172
|
} from "@ai-sdk/provider-utils";
|
|
2173
|
-
import
|
|
2173
|
+
import { z as z12 } from "zod/v4";
|
|
2174
2174
|
var localShellInputSchema = lazySchema(
|
|
2175
2175
|
() => zodSchema11(
|
|
2176
2176
|
z12.object({
|
|
@@ -2417,11 +2417,29 @@ async function convertToOpenAIResponsesInput({
|
|
|
2417
2417
|
case "error-text":
|
|
2418
2418
|
contentValue = output.value;
|
|
2419
2419
|
break;
|
|
2420
|
-
case "content":
|
|
2421
2420
|
case "json":
|
|
2422
2421
|
case "error-json":
|
|
2423
2422
|
contentValue = JSON.stringify(output.value);
|
|
2424
2423
|
break;
|
|
2424
|
+
case "content":
|
|
2425
|
+
contentValue = output.value.map((item) => {
|
|
2426
|
+
switch (item.type) {
|
|
2427
|
+
case "text": {
|
|
2428
|
+
return { type: "input_text", text: item.text };
|
|
2429
|
+
}
|
|
2430
|
+
case "media": {
|
|
2431
|
+
return item.mediaType.startsWith("image/") ? {
|
|
2432
|
+
type: "input_image",
|
|
2433
|
+
image_url: `data:${item.mediaType};base64,${item.data}`
|
|
2434
|
+
} : {
|
|
2435
|
+
type: "input_file",
|
|
2436
|
+
filename: "data",
|
|
2437
|
+
file_data: `data:${item.mediaType};base64,${item.data}`
|
|
2438
|
+
};
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
});
|
|
2442
|
+
break;
|
|
2425
2443
|
}
|
|
2426
2444
|
input.push({
|
|
2427
2445
|
type: "function_call_output",
|
|
@@ -2467,7 +2485,7 @@ import {
|
|
|
2467
2485
|
lazyValidator as lazyValidator11,
|
|
2468
2486
|
zodSchema as zodSchema12
|
|
2469
2487
|
} from "@ai-sdk/provider-utils";
|
|
2470
|
-
import
|
|
2488
|
+
import { z as z14 } from "zod/v4";
|
|
2471
2489
|
var openaiResponsesChunkSchema = lazyValidator11(
|
|
2472
2490
|
() => zodSchema12(
|
|
2473
2491
|
z14.union([
|
|
@@ -2892,7 +2910,7 @@ import {
|
|
|
2892
2910
|
lazyValidator as lazyValidator12,
|
|
2893
2911
|
zodSchema as zodSchema13
|
|
2894
2912
|
} from "@ai-sdk/provider-utils";
|
|
2895
|
-
import
|
|
2913
|
+
import { z as z15 } from "zod/v4";
|
|
2896
2914
|
var TOP_LOGPROBS_MAX = 20;
|
|
2897
2915
|
var openaiResponsesReasoningModelIds = [
|
|
2898
2916
|
"o1",
|
|
@@ -3008,7 +3026,7 @@ import {
|
|
|
3008
3026
|
lazySchema as lazySchema2,
|
|
3009
3027
|
zodSchema as zodSchema14
|
|
3010
3028
|
} from "@ai-sdk/provider-utils";
|
|
3011
|
-
import
|
|
3029
|
+
import { z as z16 } from "zod/v4";
|
|
3012
3030
|
var codeInterpreterInputSchema = lazySchema2(
|
|
3013
3031
|
() => zodSchema14(
|
|
3014
3032
|
z16.object({
|
|
@@ -3057,7 +3075,7 @@ import {
|
|
|
3057
3075
|
lazySchema as lazySchema3,
|
|
3058
3076
|
zodSchema as zodSchema15
|
|
3059
3077
|
} from "@ai-sdk/provider-utils";
|
|
3060
|
-
import
|
|
3078
|
+
import { z as z17 } from "zod/v4";
|
|
3061
3079
|
var comparisonFilterSchema = z17.object({
|
|
3062
3080
|
key: z17.string(),
|
|
3063
3081
|
type: z17.enum(["eq", "ne", "gt", "gte", "lt", "lte"]),
|
|
@@ -3111,7 +3129,7 @@ import {
|
|
|
3111
3129
|
lazySchema as lazySchema4,
|
|
3112
3130
|
zodSchema as zodSchema16
|
|
3113
3131
|
} from "@ai-sdk/provider-utils";
|
|
3114
|
-
import
|
|
3132
|
+
import { z as z18 } from "zod/v4";
|
|
3115
3133
|
var webSearchArgsSchema = lazySchema4(
|
|
3116
3134
|
() => zodSchema16(
|
|
3117
3135
|
z18.object({
|
|
@@ -3162,7 +3180,7 @@ import {
|
|
|
3162
3180
|
lazySchema as lazySchema5,
|
|
3163
3181
|
zodSchema as zodSchema17
|
|
3164
3182
|
} from "@ai-sdk/provider-utils";
|
|
3165
|
-
import
|
|
3183
|
+
import { z as z19 } from "zod/v4";
|
|
3166
3184
|
var webSearchPreviewArgsSchema = lazySchema5(
|
|
3167
3185
|
() => zodSchema17(
|
|
3168
3186
|
z19.object({
|
|
@@ -3234,7 +3252,7 @@ import {
|
|
|
3234
3252
|
lazySchema as lazySchema6,
|
|
3235
3253
|
zodSchema as zodSchema18
|
|
3236
3254
|
} from "@ai-sdk/provider-utils";
|
|
3237
|
-
import
|
|
3255
|
+
import { z as z20 } from "zod/v4";
|
|
3238
3256
|
var imageGenerationArgsSchema = lazySchema6(
|
|
3239
3257
|
() => zodSchema18(
|
|
3240
3258
|
z20.object({
|