@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/index.mjs
CHANGED
|
@@ -2847,7 +2847,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2847
2847
|
hasApplyPatchTool = false,
|
|
2848
2848
|
customProviderToolNames
|
|
2849
2849
|
}) {
|
|
2850
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2850
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
2851
2851
|
let input = [];
|
|
2852
2852
|
const warnings = [];
|
|
2853
2853
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -2984,10 +2984,11 @@ async function convertToOpenAIResponsesInput({
|
|
|
2984
2984
|
}
|
|
2985
2985
|
break;
|
|
2986
2986
|
}
|
|
2987
|
-
if (store && id != null) {
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2987
|
+
if (hasPreviousResponseId && store && id != null) {
|
|
2988
|
+
break;
|
|
2989
|
+
}
|
|
2990
|
+
const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || ((_m = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _m : false);
|
|
2991
|
+
if (store && id != null && isProviderDefinedToolCall) {
|
|
2991
2992
|
input.push({ type: "item_reference", id });
|
|
2992
2993
|
break;
|
|
2993
2994
|
}
|
|
@@ -3058,7 +3059,6 @@ async function convertToOpenAIResponsesInput({
|
|
|
3058
3059
|
call_id: part.toolCallId,
|
|
3059
3060
|
name: resolvedToolName,
|
|
3060
3061
|
arguments: serializeToolCallArguments2(part.input),
|
|
3061
|
-
id,
|
|
3062
3062
|
...namespace != null && { namespace }
|
|
3063
3063
|
});
|
|
3064
3064
|
break;
|
|
@@ -3075,7 +3075,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3075
3075
|
part.toolName
|
|
3076
3076
|
);
|
|
3077
3077
|
if (resolvedResultToolName === "tool_search") {
|
|
3078
|
-
const itemId = (
|
|
3078
|
+
const itemId = (_p = (_o = (_n = part.providerOptions) == null ? void 0 : _n[providerOptionsName]) == null ? void 0 : _o.itemId) != null ? _p : part.toolCallId;
|
|
3079
3079
|
if (store) {
|
|
3080
3080
|
input.push({ type: "item_reference", id: itemId });
|
|
3081
3081
|
} else if (part.output.type === "json") {
|
|
@@ -3116,7 +3116,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3116
3116
|
break;
|
|
3117
3117
|
}
|
|
3118
3118
|
if (store) {
|
|
3119
|
-
const itemId = (
|
|
3119
|
+
const itemId = (_s = (_r = (_q = part.providerOptions) == null ? void 0 : _q[providerOptionsName]) == null ? void 0 : _r.itemId) != null ? _s : part.toolCallId;
|
|
3120
3120
|
input.push({ type: "item_reference", id: itemId });
|
|
3121
3121
|
} else {
|
|
3122
3122
|
warnings.push({
|
|
@@ -3226,7 +3226,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3226
3226
|
}
|
|
3227
3227
|
const output = part.output;
|
|
3228
3228
|
if (output.type === "execution-denied") {
|
|
3229
|
-
const approvalId = (
|
|
3229
|
+
const approvalId = (_u = (_t = output.providerOptions) == null ? void 0 : _t.openai) == null ? void 0 : _u.approvalId;
|
|
3230
3230
|
if (approvalId) {
|
|
3231
3231
|
continue;
|
|
3232
3232
|
}
|
|
@@ -3300,7 +3300,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3300
3300
|
outputValue = output.value;
|
|
3301
3301
|
break;
|
|
3302
3302
|
case "execution-denied":
|
|
3303
|
-
outputValue = (
|
|
3303
|
+
outputValue = (_v = output.reason) != null ? _v : "Tool execution denied.";
|
|
3304
3304
|
break;
|
|
3305
3305
|
case "json":
|
|
3306
3306
|
case "error-json":
|
|
@@ -3361,7 +3361,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3361
3361
|
contentValue = output.value;
|
|
3362
3362
|
break;
|
|
3363
3363
|
case "execution-denied":
|
|
3364
|
-
contentValue = (
|
|
3364
|
+
contentValue = (_w = output.reason) != null ? _w : "Tool execution denied.";
|
|
3365
3365
|
break;
|
|
3366
3366
|
case "json":
|
|
3367
3367
|
case "error-json":
|
|
@@ -6967,7 +6967,7 @@ var OpenAITranscriptionModel = class {
|
|
|
6967
6967
|
};
|
|
6968
6968
|
|
|
6969
6969
|
// src/version.ts
|
|
6970
|
-
var VERSION = true ? "3.0.
|
|
6970
|
+
var VERSION = true ? "3.0.73" : "0.0.0-test";
|
|
6971
6971
|
|
|
6972
6972
|
// src/openai-provider.ts
|
|
6973
6973
|
function createOpenAI(options = {}) {
|