@ai-sdk/openai 4.0.77 → 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.
@@ -690,7 +690,7 @@ type OpenAIResponsesCompactionItem = {
690
690
  type OpenAIResponsesConfigurationUpdate = {
691
691
  type: 'configuration_update';
692
692
  reasoning: {
693
- effort: 'low' | 'medium' | 'high' | 'xhigh' | 'max';
693
+ effort: 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
694
694
  };
695
695
  };
696
696
  type OpenAIResponsesCompactionTrigger = {
@@ -3570,8 +3570,9 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema12(
3570
3570
  *
3571
3571
  * Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
3572
3572
  * combined with automatic compaction or automatic truncation.
3573
+ * Supported efforts vary by model; 'none' is supported by GPT-6 Sol and Luna.
3573
3574
  */
3574
- reasoningEffortUpdate: z13.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
3575
+ reasoningEffortUpdate: z13.enum(["none", "low", "medium", "high", "xhigh", "max"]).optional(),
3575
3576
  /**
3576
3577
  * Controls how much model work GPT-5.6 performs before returning a final answer.
3577
3578
  * `standard` is the default. `pro` increases quality, latency, and token usage.
@@ -3699,7 +3700,7 @@ var openaiResponsesSystemMessageOptionsSchema = lazySchema12(
3699
3700
  *
3700
3701
  * @see https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation
3701
3702
  */
3702
- reasoningEffortUpdate: z13.enum(["low", "medium", "high", "xhigh", "max"]).optional()
3703
+ reasoningEffortUpdate: z13.enum(["none", "low", "medium", "high", "xhigh", "max"]).optional()
3703
3704
  })
3704
3705
  )
3705
3706
  );
@@ -7520,12 +7521,27 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7520
7521
  outputSchemaToolNames: outputSchemaToolNames.size > 0 ? outputSchemaToolNames : void 0
7521
7522
  });
7522
7523
  warnings.push(...inputWarnings);
7524
+ const getUpdateEffortUnsupportedReason = (effort) => effort != null && modelCapabilities.supportedReasoningEfforts?.includes(effort) === false ? `${modelId} only supports the following reasoning efforts: ${modelCapabilities.supportedReasoningEfforts.join(", ")}` : void 0;
7525
+ for (const item of input) {
7526
+ if (item.type === "configuration_update") {
7527
+ const unsupportedReason = getUpdateEffortUnsupportedReason(
7528
+ item.reasoning.effort
7529
+ );
7530
+ if (unsupportedReason != null) {
7531
+ throw new UnsupportedFunctionalityError8({
7532
+ functionality: "Message-level reasoningEffortUpdate",
7533
+ message: unsupportedReason
7534
+ });
7535
+ }
7536
+ }
7537
+ }
7523
7538
  const reasoningEffortUpdate = openaiOptions?.reasoningEffortUpdate;
7524
- if (reasoningEffortUpdate != null && configurationUpdateUnsupportedReason != null) {
7539
+ const requestUpdateUnsupportedReason = configurationUpdateUnsupportedReason ?? getUpdateEffortUnsupportedReason(reasoningEffortUpdate);
7540
+ if (reasoningEffortUpdate != null && requestUpdateUnsupportedReason != null) {
7525
7541
  warnings.push({
7526
7542
  type: "unsupported",
7527
7543
  feature: "reasoningEffortUpdate",
7528
- details: configurationUpdateUnsupportedReason
7544
+ details: requestUpdateUnsupportedReason
7529
7545
  });
7530
7546
  } else if (reasoningEffortUpdate != null) {
7531
7547
  const firstItem = input[0];