@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/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;
|
|
2746
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2747
2747
|
let input = [];
|
|
2748
2748
|
const warnings = [];
|
|
2749
2749
|
const processedApprovalIds = /* @__PURE__ */ new Set();
|
|
@@ -2844,6 +2844,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2844
2844
|
}
|
|
2845
2845
|
case "tool-call": {
|
|
2846
2846
|
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;
|
|
2847
|
+
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;
|
|
2847
2848
|
if (hasConversation && id != null) {
|
|
2848
2849
|
break;
|
|
2849
2850
|
}
|
|
@@ -2867,7 +2868,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2867
2868
|
type: "tool_search_call",
|
|
2868
2869
|
id: id != null ? id : part.toolCallId,
|
|
2869
2870
|
execution,
|
|
2870
|
-
call_id: (
|
|
2871
|
+
call_id: (_l = parsedInput.call_id) != null ? _l : null,
|
|
2871
2872
|
status: "completed",
|
|
2872
2873
|
arguments: parsedInput.arguments
|
|
2873
2874
|
});
|
|
@@ -2953,7 +2954,8 @@ async function convertToOpenAIResponsesInput({
|
|
|
2953
2954
|
call_id: part.toolCallId,
|
|
2954
2955
|
name: resolvedToolName,
|
|
2955
2956
|
arguments: serializeToolCallArguments2(part.input),
|
|
2956
|
-
id
|
|
2957
|
+
id,
|
|
2958
|
+
...namespace != null && { namespace }
|
|
2957
2959
|
});
|
|
2958
2960
|
break;
|
|
2959
2961
|
}
|
|
@@ -2969,7 +2971,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
2969
2971
|
part.toolName
|
|
2970
2972
|
);
|
|
2971
2973
|
if (resolvedResultToolName === "tool_search") {
|
|
2972
|
-
const itemId = (
|
|
2974
|
+
const itemId = (_o = (_n = (_m = part.providerOptions) == null ? void 0 : _m[providerOptionsName]) == null ? void 0 : _n.itemId) != null ? _o : part.toolCallId;
|
|
2973
2975
|
if (store) {
|
|
2974
2976
|
input.push({ type: "item_reference", id: itemId });
|
|
2975
2977
|
} else if (part.output.type === "json") {
|
|
@@ -3010,7 +3012,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3010
3012
|
break;
|
|
3011
3013
|
}
|
|
3012
3014
|
if (store) {
|
|
3013
|
-
const itemId = (
|
|
3015
|
+
const itemId = (_r = (_q = (_p = part.providerOptions) == null ? void 0 : _p[providerOptionsName]) == null ? void 0 : _q.itemId) != null ? _r : part.toolCallId;
|
|
3014
3016
|
input.push({ type: "item_reference", id: itemId });
|
|
3015
3017
|
} else {
|
|
3016
3018
|
warnings.push({
|
|
@@ -3120,7 +3122,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3120
3122
|
}
|
|
3121
3123
|
const output = part.output;
|
|
3122
3124
|
if (output.type === "execution-denied") {
|
|
3123
|
-
const approvalId = (
|
|
3125
|
+
const approvalId = (_t = (_s = output.providerOptions) == null ? void 0 : _s.openai) == null ? void 0 : _t.approvalId;
|
|
3124
3126
|
if (approvalId) {
|
|
3125
3127
|
continue;
|
|
3126
3128
|
}
|
|
@@ -3194,7 +3196,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3194
3196
|
outputValue = output.value;
|
|
3195
3197
|
break;
|
|
3196
3198
|
case "execution-denied":
|
|
3197
|
-
outputValue = (
|
|
3199
|
+
outputValue = (_u = output.reason) != null ? _u : "Tool execution denied.";
|
|
3198
3200
|
break;
|
|
3199
3201
|
case "json":
|
|
3200
3202
|
case "error-json":
|
|
@@ -3255,7 +3257,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3255
3257
|
contentValue = output.value;
|
|
3256
3258
|
break;
|
|
3257
3259
|
case "execution-denied":
|
|
3258
|
-
contentValue = (
|
|
3260
|
+
contentValue = (_v = output.reason) != null ? _v : "Tool execution denied.";
|
|
3259
3261
|
break;
|
|
3260
3262
|
case "json":
|
|
3261
3263
|
case "error-json":
|
|
@@ -4758,6 +4760,7 @@ var webSearchToolFactory = createProviderToolFactoryWithOutputSchema9({
|
|
|
4758
4760
|
inputSchema: webSearchInputSchema,
|
|
4759
4761
|
outputSchema: webSearchOutputSchema
|
|
4760
4762
|
});
|
|
4763
|
+
var webSearch = (args = {}) => webSearchToolFactory(args);
|
|
4761
4764
|
|
|
4762
4765
|
// src/tool/web-search-preview.ts
|
|
4763
4766
|
import {
|
|
@@ -6840,8 +6843,12 @@ export {
|
|
|
6840
6843
|
openaiLanguageModelChatOptions,
|
|
6841
6844
|
openaiLanguageModelCompletionOptions,
|
|
6842
6845
|
openaiSpeechModelOptionsSchema,
|
|
6846
|
+
webSearch,
|
|
6847
|
+
webSearchArgsSchema,
|
|
6848
|
+
webSearchOutputSchema,
|
|
6843
6849
|
webSearchPreview,
|
|
6844
6850
|
webSearchPreviewArgsSchema,
|
|
6845
|
-
webSearchPreviewInputSchema
|
|
6851
|
+
webSearchPreviewInputSchema,
|
|
6852
|
+
webSearchToolFactory
|
|
6846
6853
|
};
|
|
6847
6854
|
//# sourceMappingURL=index.mjs.map
|