@ai-sdk/openai 4.0.16 → 4.0.18
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/dist/internal/index.js
CHANGED
|
@@ -3392,7 +3392,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3392
3392
|
hasComputerTool = false,
|
|
3393
3393
|
customProviderToolNames
|
|
3394
3394
|
}) {
|
|
3395
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
3395
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
|
|
3396
3396
|
let input = [];
|
|
3397
3397
|
const warnings = [];
|
|
3398
3398
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -3751,7 +3751,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3751
3751
|
part.toolName
|
|
3752
3752
|
);
|
|
3753
3753
|
if (resolvedResultToolName === "tool_search") {
|
|
3754
|
-
const itemId = (
|
|
3754
|
+
const itemId = (_s = (_r = (_o = (_n = part.providerOptions) == null ? void 0 : _n[providerOptionsName]) == null ? void 0 : _o.itemId) != null ? _r : (_q = (_p = part.providerMetadata) == null ? void 0 : _p[providerOptionsName]) == null ? void 0 : _q.itemId) != null ? _s : part.toolCallId;
|
|
3755
3755
|
if (store) {
|
|
3756
3756
|
input.push({ type: "item_reference", id: itemId });
|
|
3757
3757
|
} else if (part.output.type === "json") {
|
|
@@ -3792,7 +3792,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3792
3792
|
break;
|
|
3793
3793
|
}
|
|
3794
3794
|
if (store) {
|
|
3795
|
-
const itemId = (
|
|
3795
|
+
const itemId = (_v = (_u = (_t = part.providerOptions) == null ? void 0 : _t[providerOptionsName]) == null ? void 0 : _u.itemId) != null ? _v : part.toolCallId;
|
|
3796
3796
|
input.push({ type: "item_reference", id: itemId });
|
|
3797
3797
|
} else {
|
|
3798
3798
|
warnings.push({
|
|
@@ -3877,7 +3877,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3877
3877
|
}
|
|
3878
3878
|
case "custom": {
|
|
3879
3879
|
if (part.kind === "openai.compaction") {
|
|
3880
|
-
const providerOptions2 = (
|
|
3880
|
+
const providerOptions2 = (_w = part.providerOptions) == null ? void 0 : _w[providerOptionsName];
|
|
3881
3881
|
const id = providerOptions2 == null ? void 0 : providerOptions2.itemId;
|
|
3882
3882
|
if (hasConversation && id != null) {
|
|
3883
3883
|
break;
|
|
@@ -3924,7 +3924,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3924
3924
|
}
|
|
3925
3925
|
const output = part.output;
|
|
3926
3926
|
if (output.type === "execution-denied") {
|
|
3927
|
-
const approvalId = (
|
|
3927
|
+
const approvalId = (_y = (_x = output.providerOptions) == null ? void 0 : _x.openai) == null ? void 0 : _y.approvalId;
|
|
3928
3928
|
if (approvalId) {
|
|
3929
3929
|
continue;
|
|
3930
3930
|
}
|
|
@@ -4004,7 +4004,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4004
4004
|
file_id: parsedOutput.output.fileId,
|
|
4005
4005
|
detail: parsedOutput.output.detail
|
|
4006
4006
|
},
|
|
4007
|
-
acknowledged_safety_checks: (
|
|
4007
|
+
acknowledged_safety_checks: (_z = parsedOutput.acknowledgedSafetyChecks) == null ? void 0 : _z.map((safetyCheck) => ({
|
|
4008
4008
|
id: safetyCheck.id,
|
|
4009
4009
|
code: safetyCheck.code,
|
|
4010
4010
|
message: safetyCheck.message
|
|
@@ -4020,7 +4020,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4020
4020
|
outputValue = output.value;
|
|
4021
4021
|
break;
|
|
4022
4022
|
case "execution-denied":
|
|
4023
|
-
outputValue = (
|
|
4023
|
+
outputValue = (_A = output.reason) != null ? _A : "Tool call execution denied.";
|
|
4024
4024
|
break;
|
|
4025
4025
|
case "json":
|
|
4026
4026
|
case "error-json":
|
|
@@ -4119,7 +4119,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
4119
4119
|
contentValue = output.value;
|
|
4120
4120
|
break;
|
|
4121
4121
|
case "execution-denied":
|
|
4122
|
-
contentValue = (
|
|
4122
|
+
contentValue = (_B = output.reason) != null ? _B : "Tool call execution denied.";
|
|
4123
4123
|
break;
|
|
4124
4124
|
case "json":
|
|
4125
4125
|
case "error-json":
|