@ai-sdk/openai 2.0.0-beta.1 → 2.0.0-beta.2
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 +10 -0
- package/dist/index.d.mts +6 -25
- package/dist/index.d.ts +6 -25
- package/dist/index.js +320 -320
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -16
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +28 -203
- package/dist/internal/index.d.ts +28 -203
- package/dist/internal/index.js +320 -320
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +16 -16
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/internal/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
parseProviderOptions,
|
|
12
12
|
postJsonToApi
|
|
13
13
|
} from "@ai-sdk/provider-utils";
|
|
14
|
-
import { z as z5 } from "zod";
|
|
14
|
+
import { z as z5 } from "zod/v4";
|
|
15
15
|
|
|
16
16
|
// src/convert-to-openai-chat-messages.ts
|
|
17
17
|
import {
|
|
@@ -224,7 +224,7 @@ function mapOpenAIFinishReason(finishReason) {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
// src/openai-chat-options.ts
|
|
227
|
-
import { z } from "zod";
|
|
227
|
+
import { z } from "zod/v4";
|
|
228
228
|
var openaiProviderOptions = z.object({
|
|
229
229
|
/**
|
|
230
230
|
* Modify the likelihood of specified tokens appearing in the completion.
|
|
@@ -267,11 +267,11 @@ var openaiProviderOptions = z.object({
|
|
|
267
267
|
/**
|
|
268
268
|
* Metadata to associate with the request.
|
|
269
269
|
*/
|
|
270
|
-
metadata: z.record(z.string()).optional(),
|
|
270
|
+
metadata: z.record(z.string().max(64), z.string().max(512)).optional(),
|
|
271
271
|
/**
|
|
272
272
|
* Parameters for prediction mode.
|
|
273
273
|
*/
|
|
274
|
-
prediction: z.record(z.any()).optional(),
|
|
274
|
+
prediction: z.record(z.string(), z.any()).optional(),
|
|
275
275
|
/**
|
|
276
276
|
* Whether to use structured outputs.
|
|
277
277
|
*
|
|
@@ -288,7 +288,7 @@ var openaiProviderOptions = z.object({
|
|
|
288
288
|
});
|
|
289
289
|
|
|
290
290
|
// src/openai-error.ts
|
|
291
|
-
import { z as z2 } from "zod";
|
|
291
|
+
import { z as z2 } from "zod/v4";
|
|
292
292
|
import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
|
|
293
293
|
var openaiErrorDataSchema = z2.object({
|
|
294
294
|
error: z2.object({
|
|
@@ -313,7 +313,7 @@ import {
|
|
|
313
313
|
|
|
314
314
|
// src/tool/file-search.ts
|
|
315
315
|
import { createProviderDefinedToolFactory } from "@ai-sdk/provider-utils";
|
|
316
|
-
import { z as z3 } from "zod";
|
|
316
|
+
import { z as z3 } from "zod/v4";
|
|
317
317
|
var fileSearchArgsSchema = z3.object({
|
|
318
318
|
/**
|
|
319
319
|
* List of vector store IDs to search through. If not provided, searches all available vector stores.
|
|
@@ -338,7 +338,7 @@ var fileSearch = createProviderDefinedToolFactory({
|
|
|
338
338
|
|
|
339
339
|
// src/tool/web-search-preview.ts
|
|
340
340
|
import { createProviderDefinedToolFactory as createProviderDefinedToolFactory2 } from "@ai-sdk/provider-utils";
|
|
341
|
-
import { z as z4 } from "zod";
|
|
341
|
+
import { z as z4 } from "zod/v4";
|
|
342
342
|
var webSearchPreviewArgsSchema = z4.object({
|
|
343
343
|
/**
|
|
344
344
|
* Search context size to use for the web search.
|
|
@@ -1078,7 +1078,7 @@ import {
|
|
|
1078
1078
|
parseProviderOptions as parseProviderOptions2,
|
|
1079
1079
|
postJsonToApi as postJsonToApi2
|
|
1080
1080
|
} from "@ai-sdk/provider-utils";
|
|
1081
|
-
import { z as z7 } from "zod";
|
|
1081
|
+
import { z as z7 } from "zod/v4";
|
|
1082
1082
|
|
|
1083
1083
|
// src/convert-to-openai-completion-prompt.ts
|
|
1084
1084
|
import {
|
|
@@ -1159,7 +1159,7 @@ ${user}:`]
|
|
|
1159
1159
|
}
|
|
1160
1160
|
|
|
1161
1161
|
// src/openai-completion-options.ts
|
|
1162
|
-
import { z as z6 } from "zod";
|
|
1162
|
+
import { z as z6 } from "zod/v4";
|
|
1163
1163
|
var openaiCompletionProviderOptions = z6.object({
|
|
1164
1164
|
/**
|
|
1165
1165
|
Echo back the prompt in addition to the completion.
|
|
@@ -1484,10 +1484,10 @@ import {
|
|
|
1484
1484
|
parseProviderOptions as parseProviderOptions3,
|
|
1485
1485
|
postJsonToApi as postJsonToApi3
|
|
1486
1486
|
} from "@ai-sdk/provider-utils";
|
|
1487
|
-
import { z as z9 } from "zod";
|
|
1487
|
+
import { z as z9 } from "zod/v4";
|
|
1488
1488
|
|
|
1489
1489
|
// src/openai-embedding-options.ts
|
|
1490
|
-
import { z as z8 } from "zod";
|
|
1490
|
+
import { z as z8 } from "zod/v4";
|
|
1491
1491
|
var openaiEmbeddingProviderOptions = z8.object({
|
|
1492
1492
|
/**
|
|
1493
1493
|
The number of dimensions the resulting output embeddings should have.
|
|
@@ -1575,7 +1575,7 @@ import {
|
|
|
1575
1575
|
createJsonResponseHandler as createJsonResponseHandler4,
|
|
1576
1576
|
postJsonToApi as postJsonToApi4
|
|
1577
1577
|
} from "@ai-sdk/provider-utils";
|
|
1578
|
-
import { z as z10 } from "zod";
|
|
1578
|
+
import { z as z10 } from "zod/v4";
|
|
1579
1579
|
|
|
1580
1580
|
// src/openai-image-settings.ts
|
|
1581
1581
|
var modelMaxImagesPerCall = {
|
|
@@ -1677,10 +1677,10 @@ import {
|
|
|
1677
1677
|
parseProviderOptions as parseProviderOptions4,
|
|
1678
1678
|
postFormDataToApi
|
|
1679
1679
|
} from "@ai-sdk/provider-utils";
|
|
1680
|
-
import { z as z12 } from "zod";
|
|
1680
|
+
import { z as z12 } from "zod/v4";
|
|
1681
1681
|
|
|
1682
1682
|
// src/openai-transcription-options.ts
|
|
1683
|
-
import { z as z11 } from "zod";
|
|
1683
|
+
import { z as z11 } from "zod/v4";
|
|
1684
1684
|
var openAITranscriptionProviderOptions = z11.object({
|
|
1685
1685
|
/**
|
|
1686
1686
|
* Additional information to include in the transcription response.
|
|
@@ -1871,7 +1871,7 @@ import {
|
|
|
1871
1871
|
parseProviderOptions as parseProviderOptions5,
|
|
1872
1872
|
postJsonToApi as postJsonToApi5
|
|
1873
1873
|
} from "@ai-sdk/provider-utils";
|
|
1874
|
-
import { z as z13 } from "zod";
|
|
1874
|
+
import { z as z13 } from "zod/v4";
|
|
1875
1875
|
var OpenAIProviderOptionsSchema = z13.object({
|
|
1876
1876
|
instructions: z13.string().nullish(),
|
|
1877
1877
|
speed: z13.number().min(0.25).max(4).default(1).nullish()
|
|
@@ -1985,7 +1985,7 @@ import {
|
|
|
1985
1985
|
parseProviderOptions as parseProviderOptions6,
|
|
1986
1986
|
postJsonToApi as postJsonToApi6
|
|
1987
1987
|
} from "@ai-sdk/provider-utils";
|
|
1988
|
-
import { z as z14 } from "zod";
|
|
1988
|
+
import { z as z14 } from "zod/v4";
|
|
1989
1989
|
|
|
1990
1990
|
// src/responses/convert-to-openai-responses-messages.ts
|
|
1991
1991
|
import {
|