@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/index.mjs
CHANGED
|
@@ -47,6 +47,7 @@ function getOpenAILanguageModelCapabilities(modelId) {
|
|
|
47
47
|
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);
|
|
48
48
|
const isGptNanoModel = (_d = (_c = gptVersion == null ? void 0 : gptVersion.variant) == null ? void 0 : _c.startsWith("nano")) != null ? _d : false;
|
|
49
49
|
const isGpt6OrLaterModel = gptVersion != null && gptVersion.major >= 6;
|
|
50
|
+
const isGpt6SolOrLuna = modelId === "gpt-6-sol" || modelId === "gpt-6-luna";
|
|
50
51
|
const supportsFlexProcessing = oSeriesVersion != null && oSeriesVersion >= 3 || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel;
|
|
51
52
|
const supportsPriorityProcessing = modelId.startsWith("gpt-4") || gptVersion != null && gptVersion.major >= 5 && !isGptNanoModel && !isGptChatModel || oSeriesVersion != null && oSeriesVersion >= 3;
|
|
52
53
|
const isReasoningModel = oSeriesVersion != null || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel || modelId === "codex-mini-latest" || modelId === "computer-use-preview";
|
|
@@ -57,7 +58,7 @@ function getOpenAILanguageModelCapabilities(modelId) {
|
|
|
57
58
|
supportsPriorityProcessing,
|
|
58
59
|
supportsConfigurationUpdate: isGpt6OrLaterModel,
|
|
59
60
|
supportsAsyncToolCalling: isGpt6OrLaterModel,
|
|
60
|
-
supportedReasoningEfforts: isGpt6OrLaterModel ? ["low", "medium", "high", "xhigh", "max"] : void 0,
|
|
61
|
+
supportedReasoningEfforts: isGpt6SolOrLuna ? ["none", "low", "medium", "high", "xhigh", "max"] : isGpt6OrLaterModel ? ["low", "medium", "high", "xhigh", "max"] : void 0,
|
|
61
62
|
isReasoningModel,
|
|
62
63
|
systemMessageMode,
|
|
63
64
|
supportsNonReasoningParameters
|
|
@@ -942,6 +943,12 @@ var OpenAIChatLanguageModel = class {
|
|
|
942
943
|
fetch: this.config.fetch
|
|
943
944
|
});
|
|
944
945
|
const choice = response.choices[0];
|
|
946
|
+
if (choice == null) {
|
|
947
|
+
throw new InvalidResponseDataError({
|
|
948
|
+
data: rawResponse,
|
|
949
|
+
message: "Response did not contain any choices."
|
|
950
|
+
});
|
|
951
|
+
}
|
|
945
952
|
const content = [];
|
|
946
953
|
const text = choice.message.content;
|
|
947
954
|
if (text != null && text.length > 0) {
|
|
@@ -2944,7 +2951,7 @@ var openaiResponsesChunkSchema = lazyValidator9(
|
|
|
2944
2951
|
name: z17.string(),
|
|
2945
2952
|
arguments: z17.string(),
|
|
2946
2953
|
async: z17.boolean().nullish(),
|
|
2947
|
-
status: z17.
|
|
2954
|
+
status: z17.enum(["in_progress", "completed", "incomplete"])
|
|
2948
2955
|
}),
|
|
2949
2956
|
z17.object({
|
|
2950
2957
|
type: z17.literal("code_interpreter_call"),
|
|
@@ -3353,7 +3360,9 @@ var openaiResponsesReasoningModelIds = [
|
|
|
3353
3360
|
"gpt-5.6-luna",
|
|
3354
3361
|
"gpt-5.6-sol",
|
|
3355
3362
|
"gpt-5.6-terra",
|
|
3356
|
-
"gpt-6-astra"
|
|
3363
|
+
"gpt-6-astra",
|
|
3364
|
+
"gpt-6-luna",
|
|
3365
|
+
"gpt-6-sol"
|
|
3357
3366
|
];
|
|
3358
3367
|
var openaiResponsesModelIds = [
|
|
3359
3368
|
"gpt-4.1",
|
|
@@ -5227,7 +5236,7 @@ var OpenAITranscriptionModel = class {
|
|
|
5227
5236
|
};
|
|
5228
5237
|
|
|
5229
5238
|
// src/version.ts
|
|
5230
|
-
var VERSION = true ? "2.0.
|
|
5239
|
+
var VERSION = true ? "2.0.128" : "0.0.0-test";
|
|
5231
5240
|
|
|
5232
5241
|
// src/openai-provider.ts
|
|
5233
5242
|
function createOpenAI(options = {}) {
|