@ai-sdk/openai 4.0.57 → 4.0.58
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 +7 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +17 -10
- package/dist/internal/index.js +11 -4
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +4 -2
- package/package.json +1 -1
- package/src/chat/openai-chat-language-model-options.ts +2 -1
- package/src/responses/openai-responses-api.ts +9 -2
- package/src/responses/openai-responses-language-model-options.ts +2 -1
- package/src/responses/openai-responses-prepare-tools.ts +1 -0
- package/src/tool/image-generation.ts +16 -6
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ declare const openaiLanguageModelChatOptions: _ai_sdk_provider_utils.LazySchema<
|
|
|
15
15
|
store?: boolean | undefined;
|
|
16
16
|
metadata?: Record<string, string> | undefined;
|
|
17
17
|
prediction?: Record<string, any> | undefined;
|
|
18
|
-
serviceTier?: "default" | "auto" | "flex" | "priority" | "fast" | undefined;
|
|
18
|
+
serviceTier?: "default" | "auto" | "flex" | "priority" | "fast" | "ultrafast" | undefined;
|
|
19
19
|
strictJsonSchema?: boolean | undefined;
|
|
20
20
|
textVerbosity?: "low" | "medium" | "high" | undefined;
|
|
21
21
|
promptCacheKey?: string | undefined;
|
|
@@ -1128,6 +1128,7 @@ declare const openaiTools: {
|
|
|
1128
1128
|
* @param size - The size of the generated image. One of 'auto', '1024x1024', '1024x1536', or '1536x1024'.
|
|
1129
1129
|
*/
|
|
1130
1130
|
imageGeneration: (args?: {
|
|
1131
|
+
action?: "generate" | "edit" | "auto";
|
|
1131
1132
|
background?: "auto" | "opaque" | "transparent";
|
|
1132
1133
|
inputFidelity?: "low" | "high";
|
|
1133
1134
|
inputImageMask?: {
|
|
@@ -1135,12 +1136,12 @@ declare const openaiTools: {
|
|
|
1135
1136
|
imageUrl?: string;
|
|
1136
1137
|
};
|
|
1137
1138
|
model?: string;
|
|
1138
|
-
moderation?: "auto";
|
|
1139
|
+
moderation?: "auto" | "low";
|
|
1139
1140
|
outputCompression?: number;
|
|
1140
1141
|
outputFormat?: "png" | "jpeg" | "webp";
|
|
1141
1142
|
partialImages?: number;
|
|
1142
1143
|
quality?: "auto" | "low" | "medium" | "high";
|
|
1143
|
-
size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024";
|
|
1144
|
+
size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024" | (string & {});
|
|
1144
1145
|
}) => _ai_sdk_provider_utils.ProviderExecutedTool<{}, {
|
|
1145
1146
|
result: string;
|
|
1146
1147
|
}, {}>;
|
|
@@ -1385,7 +1386,7 @@ declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.
|
|
|
1385
1386
|
reasoningContext?: "auto" | "current_turn" | "all_turns" | undefined;
|
|
1386
1387
|
reasoningSummary?: string | null | undefined;
|
|
1387
1388
|
safetyIdentifier?: string | null | undefined;
|
|
1388
|
-
serviceTier?: "default" | "auto" | "flex" | "priority" | "fast" | null | undefined;
|
|
1389
|
+
serviceTier?: "default" | "auto" | "flex" | "priority" | "fast" | "ultrafast" | null | undefined;
|
|
1389
1390
|
store?: boolean | null | undefined;
|
|
1390
1391
|
passThroughUnsupportedFiles?: boolean | undefined;
|
|
1391
1392
|
strictJsonSchema?: boolean | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -837,11 +837,12 @@ var openaiLanguageModelChatOptions = lazySchema2(
|
|
|
837
837
|
* - 'flex': 50% cheaper processing at the cost of increased latency. Only available for o3 and o4-mini models.
|
|
838
838
|
* - 'priority': Higher-speed processing with predictably low latency at premium cost. Available for Enterprise customers.
|
|
839
839
|
* - 'fast': OpenAI's newer name for the 'priority' tier. Interchangeable with it.
|
|
840
|
+
* - 'ultrafast': Access-controlled Ultrafast processing. Only available for gpt-5.6-sol.
|
|
840
841
|
* - 'default': The request will be processed with the standard pricing and performance for the selected model.
|
|
841
842
|
*
|
|
842
843
|
* @default 'auto'
|
|
843
844
|
*/
|
|
844
|
-
serviceTier: z3.enum(["auto", "flex", "priority", "fast", "default"]).optional(),
|
|
845
|
+
serviceTier: z3.enum(["auto", "flex", "priority", "fast", "ultrafast", "default"]).optional(),
|
|
845
846
|
/**
|
|
846
847
|
* Whether to use strict JSON schema validation.
|
|
847
848
|
*
|
|
@@ -2957,6 +2958,7 @@ import { z as z17 } from "zod/v4";
|
|
|
2957
2958
|
var imageGenerationArgsSchema = lazySchema16(
|
|
2958
2959
|
() => zodSchema16(
|
|
2959
2960
|
z17.object({
|
|
2961
|
+
action: z17.enum(["generate", "edit", "auto"]).optional(),
|
|
2960
2962
|
background: z17.enum(["auto", "opaque", "transparent"]).optional(),
|
|
2961
2963
|
inputFidelity: z17.enum(["low", "high"]).optional(),
|
|
2962
2964
|
inputImageMask: z17.object({
|
|
@@ -2964,12 +2966,15 @@ var imageGenerationArgsSchema = lazySchema16(
|
|
|
2964
2966
|
imageUrl: z17.string().optional()
|
|
2965
2967
|
}).optional(),
|
|
2966
2968
|
model: z17.string().optional(),
|
|
2967
|
-
moderation: z17.enum(["auto"]).optional(),
|
|
2969
|
+
moderation: z17.enum(["auto", "low"]).optional(),
|
|
2968
2970
|
outputCompression: z17.number().int().min(0).max(100).optional(),
|
|
2969
2971
|
outputFormat: z17.enum(["png", "jpeg", "webp"]).optional(),
|
|
2970
2972
|
partialImages: z17.number().int().min(0).max(3).optional(),
|
|
2971
2973
|
quality: z17.enum(["auto", "low", "medium", "high"]).optional(),
|
|
2972
|
-
size: z17.
|
|
2974
|
+
size: z17.union([
|
|
2975
|
+
z17.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]),
|
|
2976
|
+
z17.string().regex(/^\d+x\d+$/)
|
|
2977
|
+
]).optional()
|
|
2973
2978
|
}).strict()
|
|
2974
2979
|
)
|
|
2975
2980
|
);
|
|
@@ -6093,10 +6098,11 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema25(
|
|
|
6093
6098
|
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
6094
6099
|
* Set to 'priority' for faster processing with Enterprise access (available for gpt-4, gpt-5, gpt-5-mini, o3, o4-mini; gpt-5-nano is not supported).
|
|
6095
6100
|
* Set to 'fast' for the same tier as 'priority' (OpenAI's newer name for it).
|
|
6101
|
+
* Set to 'ultrafast' for access-controlled Ultrafast processing (available only for gpt-5.6-sol).
|
|
6096
6102
|
*
|
|
6097
6103
|
* Defaults to 'auto'.
|
|
6098
6104
|
*/
|
|
6099
|
-
serviceTier: z27.enum(["auto", "flex", "priority", "fast", "default"]).nullish(),
|
|
6105
|
+
serviceTier: z27.enum(["auto", "flex", "priority", "fast", "ultrafast", "default"]).nullish(),
|
|
6100
6106
|
/**
|
|
6101
6107
|
* Whether to store the generation. Defaults to `true`.
|
|
6102
6108
|
*/
|
|
@@ -6368,6 +6374,7 @@ async function prepareResponsesTools({
|
|
|
6368
6374
|
});
|
|
6369
6375
|
openaiTools2.push({
|
|
6370
6376
|
type: "image_generation",
|
|
6377
|
+
action: args.action,
|
|
6371
6378
|
background: args.background,
|
|
6372
6379
|
input_fidelity: args.inputFidelity,
|
|
6373
6380
|
input_image_mask: args.inputImageMask ? {
|
|
@@ -10987,7 +10994,7 @@ var OpenAISkills = class {
|
|
|
10987
10994
|
};
|
|
10988
10995
|
|
|
10989
10996
|
// src/version.ts
|
|
10990
|
-
var VERSION = true ? "4.0.
|
|
10997
|
+
var VERSION = true ? "4.0.58" : "0.0.0-test";
|
|
10991
10998
|
|
|
10992
10999
|
// src/openai-provider.ts
|
|
10993
11000
|
function createOpenAI(options = {}) {
|