@ai-sdk/openai 3.0.72 → 3.0.73
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 +6 -0
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -12
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +11 -11
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +11 -11
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/responses/convert-to-openai-responses-input.ts +23 -5
package/dist/internal/index.mjs
CHANGED
|
@@ -2743,7 +2743,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2743
2743
|
hasApplyPatchTool = false,
|
|
2744
2744
|
customProviderToolNames
|
|
2745
2745
|
}) {
|
|
2746
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2746
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
2747
2747
|
let input = [];
|
|
2748
2748
|
const warnings = [];
|
|
2749
2749
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -2880,10 +2880,11 @@ async function convertToOpenAIResponsesInput({
|
|
|
2880
2880
|
}
|
|
2881
2881
|
break;
|
|
2882
2882
|
}
|
|
2883
|
-
if (store && id != null) {
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2883
|
+
if (hasPreviousResponseId && store && id != null) {
|
|
2884
|
+
break;
|
|
2885
|
+
}
|
|
2886
|
+
const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || ((_m = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _m : false);
|
|
2887
|
+
if (store && id != null && isProviderDefinedToolCall) {
|
|
2887
2888
|
input.push({ type: "item_reference", id });
|
|
2888
2889
|
break;
|
|
2889
2890
|
}
|
|
@@ -2954,7 +2955,6 @@ async function convertToOpenAIResponsesInput({
|
|
|
2954
2955
|
call_id: part.toolCallId,
|
|
2955
2956
|
name: resolvedToolName,
|
|
2956
2957
|
arguments: serializeToolCallArguments2(part.input),
|
|
2957
|
-
id,
|
|
2958
2958
|
...namespace != null && { namespace }
|
|
2959
2959
|
});
|
|
2960
2960
|
break;
|
|
@@ -2971,7 +2971,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2971
2971
|
part.toolName
|
|
2972
2972
|
);
|
|
2973
2973
|
if (resolvedResultToolName === "tool_search") {
|
|
2974
|
-
const itemId = (
|
|
2974
|
+
const itemId = (_p = (_o = (_n = part.providerOptions) == null ? void 0 : _n[providerOptionsName]) == null ? void 0 : _o.itemId) != null ? _p : part.toolCallId;
|
|
2975
2975
|
if (store) {
|
|
2976
2976
|
input.push({ type: "item_reference", id: itemId });
|
|
2977
2977
|
} else if (part.output.type === "json") {
|
|
@@ -3012,7 +3012,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3012
3012
|
break;
|
|
3013
3013
|
}
|
|
3014
3014
|
if (store) {
|
|
3015
|
-
const itemId = (
|
|
3015
|
+
const itemId = (_s = (_r = (_q = part.providerOptions) == null ? void 0 : _q[providerOptionsName]) == null ? void 0 : _r.itemId) != null ? _s : part.toolCallId;
|
|
3016
3016
|
input.push({ type: "item_reference", id: itemId });
|
|
3017
3017
|
} else {
|
|
3018
3018
|
warnings.push({
|
|
@@ -3122,7 +3122,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3122
3122
|
}
|
|
3123
3123
|
const output = part.output;
|
|
3124
3124
|
if (output.type === "execution-denied") {
|
|
3125
|
-
const approvalId = (
|
|
3125
|
+
const approvalId = (_u = (_t = output.providerOptions) == null ? void 0 : _t.openai) == null ? void 0 : _u.approvalId;
|
|
3126
3126
|
if (approvalId) {
|
|
3127
3127
|
continue;
|
|
3128
3128
|
}
|
|
@@ -3196,7 +3196,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3196
3196
|
outputValue = output.value;
|
|
3197
3197
|
break;
|
|
3198
3198
|
case "execution-denied":
|
|
3199
|
-
outputValue = (
|
|
3199
|
+
outputValue = (_v = output.reason) != null ? _v : "Tool execution denied.";
|
|
3200
3200
|
break;
|
|
3201
3201
|
case "json":
|
|
3202
3202
|
case "error-json":
|
|
@@ -3257,7 +3257,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3257
3257
|
contentValue = output.value;
|
|
3258
3258
|
break;
|
|
3259
3259
|
case "execution-denied":
|
|
3260
|
-
contentValue = (
|
|
3260
|
+
contentValue = (_w = output.reason) != null ? _w : "Tool execution denied.";
|
|
3261
3261
|
break;
|
|
3262
3262
|
case "json":
|
|
3263
3263
|
case "error-json":
|