@ai-sdk/openai 4.0.41 → 4.0.42

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 4.0.42
4
+
5
+ ### Patch Changes
6
+
7
+ - b6fff2e: feat(provider/openai): support explicit Responses compaction triggers
8
+
3
9
  ## 4.0.41
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1379,6 +1379,7 @@ declare const openaiLanguageModelResponsesOptionsSchema: _ai_sdk_provider_utils.
1379
1379
  type: "compaction";
1380
1380
  compactThreshold: number;
1381
1381
  }[] | null | undefined;
1382
+ compactionTrigger?: boolean | undefined;
1382
1383
  allowedTools?: {
1383
1384
  toolNames: string[];
1384
1385
  mode?: "auto" | "required" | undefined;
package/dist/index.js CHANGED
@@ -5609,6 +5609,11 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema25(
5609
5609
  compactThreshold: z27.number()
5610
5610
  })
5611
5611
  ).nullish(),
5612
+ /**
5613
+ * Request explicit server-side compaction by appending a
5614
+ * `compaction_trigger` item to the Responses input.
5615
+ */
5616
+ compactionTrigger: z27.boolean().optional(),
5612
5617
  /**
5613
5618
  * Restrict the callable tools to a subset while keeping the full tools
5614
5619
  * list intact, so prompt caching is preserved across requests with
@@ -6192,6 +6197,9 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6192
6197
  outputSchemaToolNames: outputSchemaToolNames.size > 0 ? outputSchemaToolNames : void 0
6193
6198
  });
6194
6199
  warnings.push(...inputWarnings);
6200
+ if (openaiOptions == null ? void 0 : openaiOptions.compactionTrigger) {
6201
+ input.push({ type: "compaction_trigger" });
6202
+ }
6195
6203
  const strictJsonSchema = (_g = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _g : true;
6196
6204
  let include = openaiOptions == null ? void 0 : openaiOptions.include;
6197
6205
  function addInclude(key) {
@@ -10023,7 +10031,7 @@ var OpenAISkills = class {
10023
10031
  };
10024
10032
 
10025
10033
  // src/version.ts
10026
- var VERSION = true ? "4.0.41" : "0.0.0-test";
10034
+ var VERSION = true ? "4.0.42" : "0.0.0-test";
10027
10035
 
10028
10036
  // src/openai-provider.ts
10029
10037
  function createOpenAI(options = {}) {