@ai-sdk/openai 4.0.40 → 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 +12 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +4 -1
- package/dist/internal/index.js +11 -1
- package/dist/internal/index.js.map +1 -1
- package/docs/03-openai.mdx +35 -0
- package/package.json +1 -1
- package/src/responses/convert-to-openai-responses-input.ts +6 -1
- package/src/responses/openai-responses-api.ts +6 -1
- package/src/responses/openai-responses-language-model-options.ts +6 -0
- package/src/responses/openai-responses-language-model.ts +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
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
|
+
|
|
9
|
+
## 4.0.41
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 59d6def: Reconstruct provider-executed shell calls when continuing OpenAI Responses with storage disabled.
|
|
14
|
+
|
|
3
15
|
## 4.0.40
|
|
4
16
|
|
|
5
17
|
### 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
|
@@ -4689,7 +4689,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
4689
4689
|
if (store && id != null) {
|
|
4690
4690
|
input.push({ type: "item_reference", id });
|
|
4691
4691
|
}
|
|
4692
|
-
|
|
4692
|
+
if (store || !hasShellTool || resolvedToolName !== "shell") {
|
|
4693
|
+
break;
|
|
4694
|
+
}
|
|
4693
4695
|
}
|
|
4694
4696
|
const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || hasComputerTool && resolvedToolName === "computer" || ((_o = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _o : false);
|
|
4695
4697
|
if (hasPreviousResponseId && store && id != null && isProviderDefinedToolCall) {
|
|
@@ -5607,6 +5609,11 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema25(
|
|
|
5607
5609
|
compactThreshold: z27.number()
|
|
5608
5610
|
})
|
|
5609
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(),
|
|
5610
5617
|
/**
|
|
5611
5618
|
* Restrict the callable tools to a subset while keeping the full tools
|
|
5612
5619
|
* list intact, so prompt caching is preserved across requests with
|
|
@@ -6190,6 +6197,9 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
|
|
|
6190
6197
|
outputSchemaToolNames: outputSchemaToolNames.size > 0 ? outputSchemaToolNames : void 0
|
|
6191
6198
|
});
|
|
6192
6199
|
warnings.push(...inputWarnings);
|
|
6200
|
+
if (openaiOptions == null ? void 0 : openaiOptions.compactionTrigger) {
|
|
6201
|
+
input.push({ type: "compaction_trigger" });
|
|
6202
|
+
}
|
|
6193
6203
|
const strictJsonSchema = (_g = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _g : true;
|
|
6194
6204
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|
|
6195
6205
|
function addInclude(key) {
|
|
@@ -10021,7 +10031,7 @@ var OpenAISkills = class {
|
|
|
10021
10031
|
};
|
|
10022
10032
|
|
|
10023
10033
|
// src/version.ts
|
|
10024
|
-
var VERSION = true ? "4.0.
|
|
10034
|
+
var VERSION = true ? "4.0.42" : "0.0.0-test";
|
|
10025
10035
|
|
|
10026
10036
|
// src/openai-provider.ts
|
|
10027
10037
|
function createOpenAI(options = {}) {
|