@ai-sdk/openai 2.0.126 → 2.0.128
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 +20 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +3 -3
- package/dist/internal/index.d.ts +3 -3
- package/dist/internal/index.js +12 -3
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +12 -3
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.mjs
CHANGED
|
@@ -39,6 +39,7 @@ function getOpenAILanguageModelCapabilities(modelId) {
|
|
|
39
39
|
const isGptChatModel = (gptVersion == null ? void 0 : gptVersion.minor) == null && ((_b = (_a2 = gptVersion == null ? void 0 : gptVersion.variant) == null ? void 0 : _a2.startsWith("chat")) != null ? _b : false);
|
|
40
40
|
const isGptNanoModel = (_d = (_c = gptVersion == null ? void 0 : gptVersion.variant) == null ? void 0 : _c.startsWith("nano")) != null ? _d : false;
|
|
41
41
|
const isGpt6OrLaterModel = gptVersion != null && gptVersion.major >= 6;
|
|
42
|
+
const isGpt6SolOrLuna = modelId === "gpt-6-sol" || modelId === "gpt-6-luna";
|
|
42
43
|
const supportsFlexProcessing = oSeriesVersion != null && oSeriesVersion >= 3 || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel;
|
|
43
44
|
const supportsPriorityProcessing = modelId.startsWith("gpt-4") || gptVersion != null && gptVersion.major >= 5 && !isGptNanoModel && !isGptChatModel || oSeriesVersion != null && oSeriesVersion >= 3;
|
|
44
45
|
const isReasoningModel = oSeriesVersion != null || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel || modelId === "codex-mini-latest" || modelId === "computer-use-preview";
|
|
@@ -49,7 +50,7 @@ function getOpenAILanguageModelCapabilities(modelId) {
|
|
|
49
50
|
supportsPriorityProcessing,
|
|
50
51
|
supportsConfigurationUpdate: isGpt6OrLaterModel,
|
|
51
52
|
supportsAsyncToolCalling: isGpt6OrLaterModel,
|
|
52
|
-
supportedReasoningEfforts: isGpt6OrLaterModel ? ["low", "medium", "high", "xhigh", "max"] : void 0,
|
|
53
|
+
supportedReasoningEfforts: isGpt6SolOrLuna ? ["none", "low", "medium", "high", "xhigh", "max"] : isGpt6OrLaterModel ? ["low", "medium", "high", "xhigh", "max"] : void 0,
|
|
53
54
|
isReasoningModel,
|
|
54
55
|
systemMessageMode,
|
|
55
56
|
supportsNonReasoningParameters
|
|
@@ -934,6 +935,12 @@ var OpenAIChatLanguageModel = class {
|
|
|
934
935
|
fetch: this.config.fetch
|
|
935
936
|
});
|
|
936
937
|
const choice = response.choices[0];
|
|
938
|
+
if (choice == null) {
|
|
939
|
+
throw new InvalidResponseDataError({
|
|
940
|
+
data: rawResponse,
|
|
941
|
+
message: "Response did not contain any choices."
|
|
942
|
+
});
|
|
943
|
+
}
|
|
937
944
|
const content = [];
|
|
938
945
|
const text = choice.message.content;
|
|
939
946
|
if (text != null && text.length > 0) {
|
|
@@ -2978,7 +2985,7 @@ var openaiResponsesChunkSchema = lazyValidator12(
|
|
|
2978
2985
|
name: z15.string(),
|
|
2979
2986
|
arguments: z15.string(),
|
|
2980
2987
|
async: z15.boolean().nullish(),
|
|
2981
|
-
status: z15.
|
|
2988
|
+
status: z15.enum(["in_progress", "completed", "incomplete"])
|
|
2982
2989
|
}),
|
|
2983
2990
|
z15.object({
|
|
2984
2991
|
type: z15.literal("code_interpreter_call"),
|
|
@@ -3387,7 +3394,9 @@ var openaiResponsesReasoningModelIds = [
|
|
|
3387
3394
|
"gpt-5.6-luna",
|
|
3388
3395
|
"gpt-5.6-sol",
|
|
3389
3396
|
"gpt-5.6-terra",
|
|
3390
|
-
"gpt-6-astra"
|
|
3397
|
+
"gpt-6-astra",
|
|
3398
|
+
"gpt-6-luna",
|
|
3399
|
+
"gpt-6-sol"
|
|
3391
3400
|
];
|
|
3392
3401
|
var openaiResponsesModelIds = [
|
|
3393
3402
|
"gpt-4.1",
|