@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/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
parseProviderOptions,
|
|
18
18
|
postJsonToApi
|
|
19
19
|
} from "@ai-sdk/provider-utils";
|
|
20
|
-
import { z as z5 } from "zod";
|
|
20
|
+
import { z as z5 } from "zod/v4";
|
|
21
21
|
|
|
22
22
|
// src/convert-to-openai-chat-messages.ts
|
|
23
23
|
import {
|
|
@@ -230,7 +230,7 @@ function mapOpenAIFinishReason(finishReason) {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
// src/openai-chat-options.ts
|
|
233
|
-
import { z } from "zod";
|
|
233
|
+
import { z } from "zod/v4";
|
|
234
234
|
var openaiProviderOptions = z.object({
|
|
235
235
|
/**
|
|
236
236
|
* Modify the likelihood of specified tokens appearing in the completion.
|
|
@@ -273,11 +273,11 @@ var openaiProviderOptions = z.object({
|
|
|
273
273
|
/**
|
|
274
274
|
* Metadata to associate with the request.
|
|
275
275
|
*/
|
|
276
|
-
metadata: z.record(z.string()).optional(),
|
|
276
|
+
metadata: z.record(z.string().max(64), z.string().max(512)).optional(),
|
|
277
277
|
/**
|
|
278
278
|
* Parameters for prediction mode.
|
|
279
279
|
*/
|
|
280
|
-
prediction: z.record(z.any()).optional(),
|
|
280
|
+
prediction: z.record(z.string(), z.any()).optional(),
|
|
281
281
|
/**
|
|
282
282
|
* Whether to use structured outputs.
|
|
283
283
|
*
|
|
@@ -294,7 +294,7 @@ var openaiProviderOptions = z.object({
|
|
|
294
294
|
});
|
|
295
295
|
|
|
296
296
|
// src/openai-error.ts
|
|
297
|
-
import { z as z2 } from "zod";
|
|
297
|
+
import { z as z2 } from "zod/v4";
|
|
298
298
|
import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
|
|
299
299
|
var openaiErrorDataSchema = z2.object({
|
|
300
300
|
error: z2.object({
|
|
@@ -319,7 +319,7 @@ import {
|
|
|
319
319
|
|
|
320
320
|
// src/tool/file-search.ts
|
|
321
321
|
import { createProviderDefinedToolFactory } from "@ai-sdk/provider-utils";
|
|
322
|
-
import { z as z3 } from "zod";
|
|
322
|
+
import { z as z3 } from "zod/v4";
|
|
323
323
|
var fileSearchArgsSchema = z3.object({
|
|
324
324
|
/**
|
|
325
325
|
* List of vector store IDs to search through. If not provided, searches all available vector stores.
|
|
@@ -344,7 +344,7 @@ var fileSearch = createProviderDefinedToolFactory({
|
|
|
344
344
|
|
|
345
345
|
// src/tool/web-search-preview.ts
|
|
346
346
|
import { createProviderDefinedToolFactory as createProviderDefinedToolFactory2 } from "@ai-sdk/provider-utils";
|
|
347
|
-
import { z as z4 } from "zod";
|
|
347
|
+
import { z as z4 } from "zod/v4";
|
|
348
348
|
var webSearchPreviewArgsSchema = z4.object({
|
|
349
349
|
/**
|
|
350
350
|
* Search context size to use for the web search.
|
|
@@ -1084,7 +1084,7 @@ import {
|
|
|
1084
1084
|
parseProviderOptions as parseProviderOptions2,
|
|
1085
1085
|
postJsonToApi as postJsonToApi2
|
|
1086
1086
|
} from "@ai-sdk/provider-utils";
|
|
1087
|
-
import { z as z7 } from "zod";
|
|
1087
|
+
import { z as z7 } from "zod/v4";
|
|
1088
1088
|
|
|
1089
1089
|
// src/convert-to-openai-completion-prompt.ts
|
|
1090
1090
|
import {
|
|
@@ -1165,7 +1165,7 @@ ${user}:`]
|
|
|
1165
1165
|
}
|
|
1166
1166
|
|
|
1167
1167
|
// src/openai-completion-options.ts
|
|
1168
|
-
import { z as z6 } from "zod";
|
|
1168
|
+
import { z as z6 } from "zod/v4";
|
|
1169
1169
|
var openaiCompletionProviderOptions = z6.object({
|
|
1170
1170
|
/**
|
|
1171
1171
|
Echo back the prompt in addition to the completion.
|
|
@@ -1490,10 +1490,10 @@ import {
|
|
|
1490
1490
|
parseProviderOptions as parseProviderOptions3,
|
|
1491
1491
|
postJsonToApi as postJsonToApi3
|
|
1492
1492
|
} from "@ai-sdk/provider-utils";
|
|
1493
|
-
import { z as z9 } from "zod";
|
|
1493
|
+
import { z as z9 } from "zod/v4";
|
|
1494
1494
|
|
|
1495
1495
|
// src/openai-embedding-options.ts
|
|
1496
|
-
import { z as z8 } from "zod";
|
|
1496
|
+
import { z as z8 } from "zod/v4";
|
|
1497
1497
|
var openaiEmbeddingProviderOptions = z8.object({
|
|
1498
1498
|
/**
|
|
1499
1499
|
The number of dimensions the resulting output embeddings should have.
|
|
@@ -1581,7 +1581,7 @@ import {
|
|
|
1581
1581
|
createJsonResponseHandler as createJsonResponseHandler4,
|
|
1582
1582
|
postJsonToApi as postJsonToApi4
|
|
1583
1583
|
} from "@ai-sdk/provider-utils";
|
|
1584
|
-
import { z as z10 } from "zod";
|
|
1584
|
+
import { z as z10 } from "zod/v4";
|
|
1585
1585
|
|
|
1586
1586
|
// src/openai-image-settings.ts
|
|
1587
1587
|
var modelMaxImagesPerCall = {
|
|
@@ -1689,10 +1689,10 @@ import {
|
|
|
1689
1689
|
parseProviderOptions as parseProviderOptions4,
|
|
1690
1690
|
postFormDataToApi
|
|
1691
1691
|
} from "@ai-sdk/provider-utils";
|
|
1692
|
-
import { z as z12 } from "zod";
|
|
1692
|
+
import { z as z12 } from "zod/v4";
|
|
1693
1693
|
|
|
1694
1694
|
// src/openai-transcription-options.ts
|
|
1695
|
-
import { z as z11 } from "zod";
|
|
1695
|
+
import { z as z11 } from "zod/v4";
|
|
1696
1696
|
var openAITranscriptionProviderOptions = z11.object({
|
|
1697
1697
|
/**
|
|
1698
1698
|
* Additional information to include in the transcription response.
|
|
@@ -1885,7 +1885,7 @@ import {
|
|
|
1885
1885
|
parseProviderOptions as parseProviderOptions5,
|
|
1886
1886
|
postJsonToApi as postJsonToApi5
|
|
1887
1887
|
} from "@ai-sdk/provider-utils";
|
|
1888
|
-
import { z as z13 } from "zod";
|
|
1888
|
+
import { z as z13 } from "zod/v4";
|
|
1889
1889
|
|
|
1890
1890
|
// src/responses/convert-to-openai-responses-messages.ts
|
|
1891
1891
|
import {
|
|
@@ -2871,7 +2871,7 @@ import {
|
|
|
2871
2871
|
parseProviderOptions as parseProviderOptions6,
|
|
2872
2872
|
postJsonToApi as postJsonToApi6
|
|
2873
2873
|
} from "@ai-sdk/provider-utils";
|
|
2874
|
-
import { z as z14 } from "zod";
|
|
2874
|
+
import { z as z14 } from "zod/v4";
|
|
2875
2875
|
var OpenAIProviderOptionsSchema = z14.object({
|
|
2876
2876
|
instructions: z14.string().nullish(),
|
|
2877
2877
|
speed: z14.number().min(0.25).max(4).default(1).nullish()
|