@ai-sdk/openai 3.0.67 → 3.0.68
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 +10 -0
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -9
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +10 -8
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +10 -8
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/responses/convert-to-openai-responses-input.ts +13 -0
- package/src/responses/openai-responses-api.ts +1 -0
package/dist/internal/index.js
CHANGED
|
@@ -2699,7 +2699,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2699
2699
|
hasApplyPatchTool = false,
|
|
2700
2700
|
customProviderToolNames
|
|
2701
2701
|
}) {
|
|
2702
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
2702
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2703
2703
|
let input = [];
|
|
2704
2704
|
const warnings = [];
|
|
2705
2705
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -2800,6 +2800,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2800
2800
|
}
|
|
2801
2801
|
case "tool-call": {
|
|
2802
2802
|
const id = (_f = (_c = (_b = part.providerOptions) == null ? void 0 : _b[providerOptionsName]) == null ? void 0 : _c.itemId) != null ? _f : (_e = (_d = part.providerMetadata) == null ? void 0 : _d[providerOptionsName]) == null ? void 0 : _e.itemId;
|
|
2803
|
+
const namespace = (_k = (_h = (_g = part.providerOptions) == null ? void 0 : _g[providerOptionsName]) == null ? void 0 : _h.namespace) != null ? _k : (_j = (_i = part.providerMetadata) == null ? void 0 : _i[providerOptionsName]) == null ? void 0 : _j.namespace;
|
|
2803
2804
|
if (hasConversation && id != null) {
|
|
2804
2805
|
break;
|
|
2805
2806
|
}
|
|
@@ -2823,7 +2824,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2823
2824
|
type: "tool_search_call",
|
|
2824
2825
|
id: id != null ? id : part.toolCallId,
|
|
2825
2826
|
execution,
|
|
2826
|
-
call_id: (
|
|
2827
|
+
call_id: (_l = parsedInput.call_id) != null ? _l : null,
|
|
2827
2828
|
status: "completed",
|
|
2828
2829
|
arguments: parsedInput.arguments
|
|
2829
2830
|
});
|
|
@@ -2909,7 +2910,8 @@ async function convertToOpenAIResponsesInput({
|
|
|
2909
2910
|
call_id: part.toolCallId,
|
|
2910
2911
|
name: resolvedToolName,
|
|
2911
2912
|
arguments: serializeToolCallArguments2(part.input),
|
|
2912
|
-
id
|
|
2913
|
+
id,
|
|
2914
|
+
...namespace != null && { namespace }
|
|
2913
2915
|
});
|
|
2914
2916
|
break;
|
|
2915
2917
|
}
|
|
@@ -2925,7 +2927,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2925
2927
|
part.toolName
|
|
2926
2928
|
);
|
|
2927
2929
|
if (resolvedResultToolName === "tool_search") {
|
|
2928
|
-
const itemId = (
|
|
2930
|
+
const itemId = (_o = (_n = (_m = part.providerOptions) == null ? void 0 : _m[providerOptionsName]) == null ? void 0 : _n.itemId) != null ? _o : part.toolCallId;
|
|
2929
2931
|
if (store) {
|
|
2930
2932
|
input.push({ type: "item_reference", id: itemId });
|
|
2931
2933
|
} else if (part.output.type === "json") {
|
|
@@ -2966,7 +2968,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2966
2968
|
break;
|
|
2967
2969
|
}
|
|
2968
2970
|
if (store) {
|
|
2969
|
-
const itemId = (
|
|
2971
|
+
const itemId = (_r = (_q = (_p = part.providerOptions) == null ? void 0 : _p[providerOptionsName]) == null ? void 0 : _q.itemId) != null ? _r : part.toolCallId;
|
|
2970
2972
|
input.push({ type: "item_reference", id: itemId });
|
|
2971
2973
|
} else {
|
|
2972
2974
|
warnings.push({
|
|
@@ -3076,7 +3078,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3076
3078
|
}
|
|
3077
3079
|
const output = part.output;
|
|
3078
3080
|
if (output.type === "execution-denied") {
|
|
3079
|
-
const approvalId = (
|
|
3081
|
+
const approvalId = (_t = (_s = output.providerOptions) == null ? void 0 : _s.openai) == null ? void 0 : _t.approvalId;
|
|
3080
3082
|
if (approvalId) {
|
|
3081
3083
|
continue;
|
|
3082
3084
|
}
|
|
@@ -3150,7 +3152,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3150
3152
|
outputValue = output.value;
|
|
3151
3153
|
break;
|
|
3152
3154
|
case "execution-denied":
|
|
3153
|
-
outputValue = (
|
|
3155
|
+
outputValue = (_u = output.reason) != null ? _u : "Tool execution denied.";
|
|
3154
3156
|
break;
|
|
3155
3157
|
case "json":
|
|
3156
3158
|
case "error-json":
|
|
@@ -3211,7 +3213,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3211
3213
|
contentValue = output.value;
|
|
3212
3214
|
break;
|
|
3213
3215
|
case "execution-denied":
|
|
3214
|
-
contentValue = (
|
|
3216
|
+
contentValue = (_v = output.reason) != null ? _v : "Tool execution denied.";
|
|
3215
3217
|
break;
|
|
3216
3218
|
case "json":
|
|
3217
3219
|
case "error-json":
|