@ai-sdk/openai 3.0.66 → 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 +16 -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.d.mts +195 -1
- package/dist/internal/index.d.ts +195 -1
- package/dist/internal/index.js +21 -10
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +16 -9
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/internal/index.ts +1 -0
- package/src/responses/convert-to-openai-responses-input.ts +13 -0
- package/src/responses/openai-responses-api.ts +1 -0
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;
|
|
2850
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2851
2851
|
let input = [];
|
|
2852
2852
|
const warnings = [];
|
|
2853
2853
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -2948,6 +2948,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2948
2948
|
}
|
|
2949
2949
|
case "tool-call": {
|
|
2950
2950
|
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;
|
|
2951
|
+
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;
|
|
2951
2952
|
if (hasConversation && id != null) {
|
|
2952
2953
|
break;
|
|
2953
2954
|
}
|
|
@@ -2971,7 +2972,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2971
2972
|
type: "tool_search_call",
|
|
2972
2973
|
id: id != null ? id : part.toolCallId,
|
|
2973
2974
|
execution,
|
|
2974
|
-
call_id: (
|
|
2975
|
+
call_id: (_l = parsedInput.call_id) != null ? _l : null,
|
|
2975
2976
|
status: "completed",
|
|
2976
2977
|
arguments: parsedInput.arguments
|
|
2977
2978
|
});
|
|
@@ -3057,7 +3058,8 @@ async function convertToOpenAIResponsesInput({
|
|
|
3057
3058
|
call_id: part.toolCallId,
|
|
3058
3059
|
name: resolvedToolName,
|
|
3059
3060
|
arguments: serializeToolCallArguments2(part.input),
|
|
3060
|
-
id
|
|
3061
|
+
id,
|
|
3062
|
+
...namespace != null && { namespace }
|
|
3061
3063
|
});
|
|
3062
3064
|
break;
|
|
3063
3065
|
}
|
|
@@ -3073,7 +3075,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3073
3075
|
part.toolName
|
|
3074
3076
|
);
|
|
3075
3077
|
if (resolvedResultToolName === "tool_search") {
|
|
3076
|
-
const itemId = (
|
|
3078
|
+
const itemId = (_o = (_n = (_m = part.providerOptions) == null ? void 0 : _m[providerOptionsName]) == null ? void 0 : _n.itemId) != null ? _o : part.toolCallId;
|
|
3077
3079
|
if (store) {
|
|
3078
3080
|
input.push({ type: "item_reference", id: itemId });
|
|
3079
3081
|
} else if (part.output.type === "json") {
|
|
@@ -3114,7 +3116,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3114
3116
|
break;
|
|
3115
3117
|
}
|
|
3116
3118
|
if (store) {
|
|
3117
|
-
const itemId = (
|
|
3119
|
+
const itemId = (_r = (_q = (_p = part.providerOptions) == null ? void 0 : _p[providerOptionsName]) == null ? void 0 : _q.itemId) != null ? _r : part.toolCallId;
|
|
3118
3120
|
input.push({ type: "item_reference", id: itemId });
|
|
3119
3121
|
} else {
|
|
3120
3122
|
warnings.push({
|
|
@@ -3224,7 +3226,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3224
3226
|
}
|
|
3225
3227
|
const output = part.output;
|
|
3226
3228
|
if (output.type === "execution-denied") {
|
|
3227
|
-
const approvalId = (
|
|
3229
|
+
const approvalId = (_t = (_s = output.providerOptions) == null ? void 0 : _s.openai) == null ? void 0 : _t.approvalId;
|
|
3228
3230
|
if (approvalId) {
|
|
3229
3231
|
continue;
|
|
3230
3232
|
}
|
|
@@ -3298,7 +3300,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3298
3300
|
outputValue = output.value;
|
|
3299
3301
|
break;
|
|
3300
3302
|
case "execution-denied":
|
|
3301
|
-
outputValue = (
|
|
3303
|
+
outputValue = (_u = output.reason) != null ? _u : "Tool execution denied.";
|
|
3302
3304
|
break;
|
|
3303
3305
|
case "json":
|
|
3304
3306
|
case "error-json":
|
|
@@ -3359,7 +3361,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3359
3361
|
contentValue = output.value;
|
|
3360
3362
|
break;
|
|
3361
3363
|
case "execution-denied":
|
|
3362
|
-
contentValue = (
|
|
3364
|
+
contentValue = (_v = output.reason) != null ? _v : "Tool execution denied.";
|
|
3363
3365
|
break;
|
|
3364
3366
|
case "json":
|
|
3365
3367
|
case "error-json":
|
|
@@ -6934,7 +6936,7 @@ var OpenAITranscriptionModel = class {
|
|
|
6934
6936
|
};
|
|
6935
6937
|
|
|
6936
6938
|
// src/version.ts
|
|
6937
|
-
var VERSION = true ? "3.0.
|
|
6939
|
+
var VERSION = true ? "3.0.68" : "0.0.0-test";
|
|
6938
6940
|
|
|
6939
6941
|
// src/openai-provider.ts
|
|
6940
6942
|
function createOpenAI(options = {}) {
|