@ai-sdk/openai 4.0.77 → 4.0.79
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 +26 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +47 -5
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +7 -1
- package/dist/internal/index.js +46 -4
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +5 -1
- package/package.json +3 -3
- package/src/image/openai-image-model.ts +37 -0
- package/src/responses/openai-responses-api.ts +1 -1
- package/src/responses/openai-responses-language-model-options.ts +3 -2
- package/src/responses/openai-responses-language-model.ts +28 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 4.0.79
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e3605f6: Fix streamed tool calls with missing, blank, or repeated IDs.
|
|
8
|
+
- 525efc5: feat(provider): advertise image model file and mask input support
|
|
9
|
+
|
|
10
|
+
Use confirmed model IDs for capability declarations so unrecognized model names
|
|
11
|
+
remain unknown. Include Together AI FLUX.2 Pro and Flex single-image editing, and
|
|
12
|
+
allow asynchronous capability lookups and middleware overrides to resolve to
|
|
13
|
+
unknown.
|
|
14
|
+
|
|
15
|
+
Advertise QuiverAI Arrow 2 and Arrow 2 Telos file-input support, and mark Together
|
|
16
|
+
AI Gemini image inputs unsupported by the current single-image request mapping.
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [e3605f6]
|
|
19
|
+
- Updated dependencies [525efc5]
|
|
20
|
+
- @ai-sdk/provider-utils@5.0.50
|
|
21
|
+
- @ai-sdk/provider@4.0.19
|
|
22
|
+
|
|
23
|
+
## 4.0.78
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- 94d5d6d: Support `reasoningEffortUpdate: 'none'` for GPT-6 Sol and Luna in request-level options and positioned system messages. Validate update efforts against the model's supported efforts, warning and omitting unsupported request-level updates and rejecting unsupported historical updates.
|
|
28
|
+
|
|
3
29
|
## 4.0.77
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1515,7 +1515,7 @@ declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.
|
|
|
1515
1515
|
} | undefined;
|
|
1516
1516
|
promptCacheRetention?: "in_memory" | "24h" | null | undefined;
|
|
1517
1517
|
reasoningEffort?: string | null | undefined;
|
|
1518
|
-
reasoningEffortUpdate?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
1518
|
+
reasoningEffortUpdate?: "none" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
1519
1519
|
reasoningMode?: "standard" | "pro" | undefined;
|
|
1520
1520
|
reasoningContext?: "auto" | "current_turn" | "all_turns" | undefined;
|
|
1521
1521
|
reasoningSummary?: string | null | undefined;
|
|
@@ -1541,7 +1541,7 @@ declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.
|
|
|
1541
1541
|
}>;
|
|
1542
1542
|
type OpenAILanguageModelResponsesOptions = InferSchema<typeof openaiLanguageModelResponsesOptionsSchema>;
|
|
1543
1543
|
declare const openaiResponsesSystemMessageOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
1544
|
-
reasoningEffortUpdate?: "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
1544
|
+
reasoningEffortUpdate?: "none" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
|
|
1545
1545
|
}>;
|
|
1546
1546
|
type OpenAIResponsesSystemMessageOptions = InferSchema<typeof openaiResponsesSystemMessageOptionsSchema>;
|
|
1547
1547
|
|
package/dist/index.js
CHANGED
|
@@ -2657,6 +2657,32 @@ var OpenAIImageModel = class _OpenAIImageModel {
|
|
|
2657
2657
|
get maxImagesPerCall() {
|
|
2658
2658
|
return getMaxImagesPerCall(this.modelId);
|
|
2659
2659
|
}
|
|
2660
|
+
get supportsFileInputs() {
|
|
2661
|
+
if (this.config.imageInputCapabilities != null) {
|
|
2662
|
+
return this.config.imageInputCapabilities.supportsFileInputs;
|
|
2663
|
+
}
|
|
2664
|
+
if ([
|
|
2665
|
+
"dall-e-2",
|
|
2666
|
+
"gpt-image-1",
|
|
2667
|
+
"gpt-image-1-mini",
|
|
2668
|
+
"gpt-image-1.5",
|
|
2669
|
+
"gpt-image-2",
|
|
2670
|
+
"gpt-image-2.5-flare",
|
|
2671
|
+
"gpt-image-2.5-flare-2026-09-08",
|
|
2672
|
+
"gpt-image-2.5-sunburst",
|
|
2673
|
+
"gpt-image-2.5-sunburst-2026-09-08",
|
|
2674
|
+
"chatgpt-image-latest"
|
|
2675
|
+
].includes(this.modelId)) {
|
|
2676
|
+
return true;
|
|
2677
|
+
}
|
|
2678
|
+
return this.modelId === "dall-e-3" ? false : void 0;
|
|
2679
|
+
}
|
|
2680
|
+
get supportsMaskInputs() {
|
|
2681
|
+
if (this.config.imageInputCapabilities != null) {
|
|
2682
|
+
return this.config.imageInputCapabilities.supportsMaskInputs;
|
|
2683
|
+
}
|
|
2684
|
+
return this.supportsFileInputs;
|
|
2685
|
+
}
|
|
2660
2686
|
get provider() {
|
|
2661
2687
|
return this.config.provider;
|
|
2662
2688
|
}
|
|
@@ -5070,8 +5096,9 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema25(
|
|
|
5070
5096
|
*
|
|
5071
5097
|
* Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
|
|
5072
5098
|
* combined with automatic compaction or automatic truncation.
|
|
5099
|
+
* Supported efforts vary by model; 'none' is supported by GPT-6 Sol and Luna.
|
|
5073
5100
|
*/
|
|
5074
|
-
reasoningEffortUpdate: z26.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
5101
|
+
reasoningEffortUpdate: z26.enum(["none", "low", "medium", "high", "xhigh", "max"]).optional(),
|
|
5075
5102
|
/**
|
|
5076
5103
|
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
5077
5104
|
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
@@ -5199,7 +5226,7 @@ var openaiResponsesSystemMessageOptionsSchema = lazySchema25(
|
|
|
5199
5226
|
*
|
|
5200
5227
|
* @see https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation
|
|
5201
5228
|
*/
|
|
5202
|
-
reasoningEffortUpdate: z26.enum(["low", "medium", "high", "xhigh", "max"]).optional()
|
|
5229
|
+
reasoningEffortUpdate: z26.enum(["none", "low", "medium", "high", "xhigh", "max"]).optional()
|
|
5203
5230
|
})
|
|
5204
5231
|
)
|
|
5205
5232
|
);
|
|
@@ -7232,12 +7259,27 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
7232
7259
|
outputSchemaToolNames: outputSchemaToolNames.size > 0 ? outputSchemaToolNames : void 0
|
|
7233
7260
|
});
|
|
7234
7261
|
warnings.push(...inputWarnings);
|
|
7262
|
+
const getUpdateEffortUnsupportedReason = (effort) => effort != null && modelCapabilities.supportedReasoningEfforts?.includes(effort) === false ? `${modelId} only supports the following reasoning efforts: ${modelCapabilities.supportedReasoningEfforts.join(", ")}` : void 0;
|
|
7263
|
+
for (const item of input) {
|
|
7264
|
+
if (item.type === "configuration_update") {
|
|
7265
|
+
const unsupportedReason = getUpdateEffortUnsupportedReason(
|
|
7266
|
+
item.reasoning.effort
|
|
7267
|
+
);
|
|
7268
|
+
if (unsupportedReason != null) {
|
|
7269
|
+
throw new UnsupportedFunctionalityError7({
|
|
7270
|
+
functionality: "Message-level reasoningEffortUpdate",
|
|
7271
|
+
message: unsupportedReason
|
|
7272
|
+
});
|
|
7273
|
+
}
|
|
7274
|
+
}
|
|
7275
|
+
}
|
|
7235
7276
|
const reasoningEffortUpdate = openaiOptions?.reasoningEffortUpdate;
|
|
7236
|
-
|
|
7277
|
+
const requestUpdateUnsupportedReason = configurationUpdateUnsupportedReason ?? getUpdateEffortUnsupportedReason(reasoningEffortUpdate);
|
|
7278
|
+
if (reasoningEffortUpdate != null && requestUpdateUnsupportedReason != null) {
|
|
7237
7279
|
warnings.push({
|
|
7238
7280
|
type: "unsupported",
|
|
7239
7281
|
feature: "reasoningEffortUpdate",
|
|
7240
|
-
details:
|
|
7282
|
+
details: requestUpdateUnsupportedReason
|
|
7241
7283
|
});
|
|
7242
7284
|
} else if (reasoningEffortUpdate != null) {
|
|
7243
7285
|
const firstItem = input[0];
|
|
@@ -12012,7 +12054,7 @@ var OpenAISkills = class {
|
|
|
12012
12054
|
};
|
|
12013
12055
|
|
|
12014
12056
|
// src/version.ts
|
|
12015
|
-
var VERSION = true ? "4.0.
|
|
12057
|
+
var VERSION = true ? "4.0.79" : "0.0.0-test";
|
|
12016
12058
|
|
|
12017
12059
|
// src/openai-provider.ts
|
|
12018
12060
|
function createOpenAI(options = {}) {
|