@ai-sdk/openai 2.0.45 → 2.0.47
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 +12 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +25 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -5
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +1 -1
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +24 -4
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +24 -4
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazyValidat
|
|
|
14
14
|
metadata?: Record<string, string> | undefined;
|
|
15
15
|
prediction?: Record<string, any> | undefined;
|
|
16
16
|
structuredOutputs?: boolean | undefined;
|
|
17
|
-
serviceTier?: "auto" | "flex" | "priority" | undefined;
|
|
17
|
+
serviceTier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
18
18
|
strictJsonSchema?: boolean | undefined;
|
|
19
19
|
textVerbosity?: "low" | "medium" | "high" | undefined;
|
|
20
20
|
promptCacheKey?: string | undefined;
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ declare const openaiChatLanguageModelOptions: _ai_sdk_provider_utils.LazyValidat
|
|
|
14
14
|
metadata?: Record<string, string> | undefined;
|
|
15
15
|
prediction?: Record<string, any> | undefined;
|
|
16
16
|
structuredOutputs?: boolean | undefined;
|
|
17
|
-
serviceTier?: "auto" | "flex" | "priority" | undefined;
|
|
17
|
+
serviceTier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
18
18
|
strictJsonSchema?: boolean | undefined;
|
|
19
19
|
textVerbosity?: "low" | "medium" | "high" | undefined;
|
|
20
20
|
promptCacheKey?: string | undefined;
|
package/dist/internal/index.js
CHANGED
|
@@ -487,13 +487,15 @@ var openaiChatLanguageModelOptions = (0, import_provider_utils4.lazyValidator)(
|
|
|
487
487
|
structuredOutputs: z3.boolean().optional(),
|
|
488
488
|
/**
|
|
489
489
|
* Service tier for the request.
|
|
490
|
-
* - 'auto': Default service tier
|
|
490
|
+
* - 'auto': Default service tier. The request will be processed with the service tier configured in the
|
|
491
|
+
* Project settings. Unless otherwise configured, the Project will use 'default'.
|
|
491
492
|
* - 'flex': 50% cheaper processing at the cost of increased latency. Only available for o3 and o4-mini models.
|
|
492
493
|
* - 'priority': Higher-speed processing with predictably low latency at premium cost. Available for Enterprise customers.
|
|
494
|
+
* - 'default': The request will be processed with the standard pricing and performance for the selected model.
|
|
493
495
|
*
|
|
494
496
|
* @default 'auto'
|
|
495
497
|
*/
|
|
496
|
-
serviceTier: z3.enum(["auto", "flex", "priority"]).optional(),
|
|
498
|
+
serviceTier: z3.enum(["auto", "flex", "priority", "default"]).optional(),
|
|
497
499
|
/**
|
|
498
500
|
* Whether to use strict JSON schema validation.
|
|
499
501
|
*
|
|
@@ -2389,11 +2391,29 @@ async function convertToOpenAIResponsesInput({
|
|
|
2389
2391
|
case "error-text":
|
|
2390
2392
|
contentValue = output.value;
|
|
2391
2393
|
break;
|
|
2392
|
-
case "content":
|
|
2393
2394
|
case "json":
|
|
2394
2395
|
case "error-json":
|
|
2395
2396
|
contentValue = JSON.stringify(output.value);
|
|
2396
2397
|
break;
|
|
2398
|
+
case "content":
|
|
2399
|
+
contentValue = output.value.map((item) => {
|
|
2400
|
+
switch (item.type) {
|
|
2401
|
+
case "text": {
|
|
2402
|
+
return { type: "input_text", text: item.text };
|
|
2403
|
+
}
|
|
2404
|
+
case "media": {
|
|
2405
|
+
return item.mediaType.startsWith("image/") ? {
|
|
2406
|
+
type: "input_image",
|
|
2407
|
+
image_url: `data:${item.mediaType};base64,${item.data}`
|
|
2408
|
+
} : {
|
|
2409
|
+
type: "input_file",
|
|
2410
|
+
filename: "data",
|
|
2411
|
+
file_data: `data:${item.mediaType};base64,${item.data}`
|
|
2412
|
+
};
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
});
|
|
2416
|
+
break;
|
|
2397
2417
|
}
|
|
2398
2418
|
input.push({
|
|
2399
2419
|
type: "function_call_output",
|
|
@@ -2954,7 +2974,7 @@ var openaiResponsesProviderOptionsSchema = (0, import_provider_utils22.lazyValid
|
|
|
2954
2974
|
reasoningEffort: z15.string().nullish(),
|
|
2955
2975
|
reasoningSummary: z15.string().nullish(),
|
|
2956
2976
|
safetyIdentifier: z15.string().nullish(),
|
|
2957
|
-
serviceTier: z15.enum(["auto", "flex", "priority"]).nullish(),
|
|
2977
|
+
serviceTier: z15.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
2958
2978
|
store: z15.boolean().nullish(),
|
|
2959
2979
|
strictJsonSchema: z15.boolean().nullish(),
|
|
2960
2980
|
textVerbosity: z15.enum(["low", "medium", "high"]).nullish(),
|