@ai-sdk/openai 4.0.75 → 4.0.78

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.
@@ -203,13 +203,17 @@ The following provider options are available:
203
203
  and returns a warning. Use the Responses API for GPT-6 tool calling.
204
204
  </Note>
205
205
 
206
- - **reasoningEffortUpdate** _'low' | 'medium' | 'high' | 'xhigh' | 'max'_
206
+ - **reasoningEffortUpdate** _'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'_
207
207
  Updates the reasoning effort for GPT-6 and later models starting with the
208
208
  current response without changing the request-level effort. Use this with
209
209
  `previousResponseId` to preserve the original prompt prefix for caching.
210
210
  Configuration updates require standard, single-agent mode and cannot be
211
211
  combined with automatic compaction or automatic truncation.
212
212
 
213
+ The SDK checks effort values against the selected model for both request-level
214
+ and message-level updates. For example, GPT-6 Sol and Luna support `none`,
215
+ while GPT-6 Astra does not.
216
+
213
217
  - **reasoningMode** _'standard' | 'pro'_
214
218
  Controls how much model work GPT-5.6 performs before returning a final answer. `'standard'` is the default. Use `'pro'` for difficult tasks where quality matters more than latency and token usage.
215
219
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/openai",
3
- "version": "4.0.75",
3
+ "version": "4.0.78",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -36,10 +36,10 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@ai-sdk/provider": "4.0.18",
39
- "@ai-sdk/provider-utils": "5.0.47"
39
+ "@ai-sdk/provider-utils": "5.0.49"
40
40
  },
41
41
  "devDependencies": {
42
- "@ai-sdk/test-server": "2.0.1",
42
+ "@ai-sdk/test-server": "2.0.2",
43
43
  "@types/node": "22.19.19",
44
44
  "@vercel/ai-tsconfig": "0.0.0",
45
45
  "tsup": "^8.5.1",
@@ -486,7 +486,7 @@ export type OpenAIResponsesCompactionItem = {
486
486
  export type OpenAIResponsesConfigurationUpdate = {
487
487
  type: 'configuration_update';
488
488
  reasoning: {
489
- effort: 'low' | 'medium' | 'high' | 'xhigh' | 'max';
489
+ effort: 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
490
490
  };
491
491
  };
492
492
 
@@ -284,9 +284,10 @@ export const openaiLanguageModelResponsesOptionsSchema = lazySchema(() =>
284
284
  *
285
285
  * Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
286
286
  * combined with automatic compaction or automatic truncation.
287
+ * Supported efforts vary by model; 'none' is supported by GPT-6 Sol and Luna.
287
288
  */
288
289
  reasoningEffortUpdate: z
289
- .enum(['low', 'medium', 'high', 'xhigh', 'max'])
290
+ .enum(['none', 'low', 'medium', 'high', 'xhigh', 'max'])
290
291
  .optional(),
291
292
 
292
293
  /**
@@ -445,7 +446,7 @@ export const openaiResponsesSystemMessageOptionsSchema = lazySchema(() =>
445
446
  * @see https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation
446
447
  */
447
448
  reasoningEffortUpdate: z
448
- .enum(['low', 'medium', 'high', 'xhigh', 'max'])
449
+ .enum(['none', 'low', 'medium', 'high', 'xhigh', 'max'])
449
450
  .optional(),
450
451
  }),
451
452
  ),
@@ -451,15 +451,41 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV4 {
451
451
 
452
452
  warnings.push(...inputWarnings);
453
453
 
454
+ // The schema accepts update efforts supported by any supported model. Check
455
+ // whether this specific model supports the requested effort.
456
+ const getUpdateEffortUnsupportedReason = (effort: string | undefined) =>
457
+ effort != null &&
458
+ modelCapabilities.supportedReasoningEfforts?.includes(effort) === false
459
+ ? `${modelId} only supports the following reasoning efforts: ${modelCapabilities.supportedReasoningEfforts.join(', ')}`
460
+ : undefined;
461
+
462
+ // Reject configuration updates whose effort value is unsupported by the selected model.
463
+ for (const item of input) {
464
+ if (item.type === 'configuration_update') {
465
+ const unsupportedReason = getUpdateEffortUnsupportedReason(
466
+ item.reasoning.effort,
467
+ );
468
+ if (unsupportedReason != null) {
469
+ throw new UnsupportedFunctionalityError({
470
+ functionality: 'Message-level reasoningEffortUpdate',
471
+ message: unsupportedReason,
472
+ });
473
+ }
474
+ }
475
+ }
476
+
454
477
  const reasoningEffortUpdate = openaiOptions?.reasoningEffortUpdate;
478
+ const requestUpdateUnsupportedReason =
479
+ configurationUpdateUnsupportedReason ??
480
+ getUpdateEffortUnsupportedReason(reasoningEffortUpdate);
455
481
  if (
456
482
  reasoningEffortUpdate != null &&
457
- configurationUpdateUnsupportedReason != null
483
+ requestUpdateUnsupportedReason != null
458
484
  ) {
459
485
  warnings.push({
460
486
  type: 'unsupported',
461
487
  feature: 'reasoningEffortUpdate',
462
- details: configurationUpdateUnsupportedReason,
488
+ details: requestUpdateUnsupportedReason,
463
489
  });
464
490
  } else if (reasoningEffortUpdate != null) {
465
491
  const firstItem = input[0];
@@ -655,7 +655,7 @@ function prepareFunctionTool({
655
655
  description: tool.description,
656
656
  parameters: normalizedInputSchema.schema,
657
657
  ...(async != null ? { async } : {}),
658
- ...(tool.strict != null ? { strict: tool.strict } : {}),
658
+ strict: tool.strict ?? false,
659
659
  ...(deferLoading != null ? { defer_loading: deferLoading } : {}),
660
660
  ...(options?.allowedCallers != null
661
661
  ? { allowed_callers: options.allowedCallers }