@ai-sdk/openai 2.0.54 → 2.0.56
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 +12 -0
- package/dist/index.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +28 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -7
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +27 -6
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +27 -6
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1992,7 +1992,8 @@ var webSearchOutputSchema = lazySchema5(
|
|
|
1992
1992
|
url: z13.string(),
|
|
1993
1993
|
pattern: z13.string()
|
|
1994
1994
|
})
|
|
1995
|
-
])
|
|
1995
|
+
]),
|
|
1996
|
+
sources: z13.array(z13.object({ type: z13.literal("url"), url: z13.string() })).optional()
|
|
1996
1997
|
})
|
|
1997
1998
|
)
|
|
1998
1999
|
);
|
|
@@ -2595,7 +2596,8 @@ var openaiResponsesChunkSchema = lazyValidator8(
|
|
|
2595
2596
|
action: z16.discriminatedUnion("type", [
|
|
2596
2597
|
z16.object({
|
|
2597
2598
|
type: z16.literal("search"),
|
|
2598
|
-
query: z16.string().nullish()
|
|
2599
|
+
query: z16.string().nullish(),
|
|
2600
|
+
sources: z16.array(z16.object({ type: z16.literal("url"), url: z16.string() })).nullish()
|
|
2599
2601
|
}),
|
|
2600
2602
|
z16.object({
|
|
2601
2603
|
type: z16.literal("open_page"),
|
|
@@ -2781,7 +2783,8 @@ var openaiResponsesResponseSchema = lazyValidator8(
|
|
|
2781
2783
|
action: z16.discriminatedUnion("type", [
|
|
2782
2784
|
z16.object({
|
|
2783
2785
|
type: z16.literal("search"),
|
|
2784
|
-
query: z16.string().nullish()
|
|
2786
|
+
query: z16.string().nullish(),
|
|
2787
|
+
sources: z16.array(z16.object({ type: z16.literal("url"), url: z16.string() })).nullish()
|
|
2785
2788
|
}),
|
|
2786
2789
|
z16.object({
|
|
2787
2790
|
type: z16.literal("open_page"),
|
|
@@ -3468,7 +3471,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3468
3471
|
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : generateId2(),
|
|
3469
3472
|
mediaType: "text/plain",
|
|
3470
3473
|
title: (_k = (_j = annotation.quote) != null ? _j : annotation.filename) != null ? _k : "Document",
|
|
3471
|
-
filename: (_l = annotation.filename) != null ? _l : annotation.file_id
|
|
3474
|
+
filename: (_l = annotation.filename) != null ? _l : annotation.file_id,
|
|
3475
|
+
...annotation.file_id ? {
|
|
3476
|
+
providerMetadata: {
|
|
3477
|
+
openai: {
|
|
3478
|
+
fileId: annotation.file_id
|
|
3479
|
+
}
|
|
3480
|
+
}
|
|
3481
|
+
} : {}
|
|
3472
3482
|
});
|
|
3473
3483
|
}
|
|
3474
3484
|
}
|
|
@@ -4046,7 +4056,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4046
4056
|
id: (_s = (_r = (_q = self.config).generateId) == null ? void 0 : _r.call(_q)) != null ? _s : generateId2(),
|
|
4047
4057
|
mediaType: "text/plain",
|
|
4048
4058
|
title: (_u = (_t = value.annotation.quote) != null ? _t : value.annotation.filename) != null ? _u : "Document",
|
|
4049
|
-
filename: (_v = value.annotation.filename) != null ? _v : value.annotation.file_id
|
|
4059
|
+
filename: (_v = value.annotation.filename) != null ? _v : value.annotation.file_id,
|
|
4060
|
+
...value.annotation.file_id ? {
|
|
4061
|
+
providerMetadata: {
|
|
4062
|
+
openai: {
|
|
4063
|
+
fileId: value.annotation.file_id
|
|
4064
|
+
}
|
|
4065
|
+
}
|
|
4066
|
+
} : {}
|
|
4050
4067
|
});
|
|
4051
4068
|
}
|
|
4052
4069
|
} else if (isErrorChunk(value)) {
|
|
@@ -4146,7 +4163,11 @@ function mapWebSearchOutput(action) {
|
|
|
4146
4163
|
var _a;
|
|
4147
4164
|
switch (action.type) {
|
|
4148
4165
|
case "search":
|
|
4149
|
-
return {
|
|
4166
|
+
return {
|
|
4167
|
+
action: { type: "search", query: (_a = action.query) != null ? _a : void 0 },
|
|
4168
|
+
// include sources when provided by the Responses API (behind include flag)
|
|
4169
|
+
...action.sources != null && { sources: action.sources }
|
|
4170
|
+
};
|
|
4150
4171
|
case "open_page":
|
|
4151
4172
|
return { action: { type: "openPage", url: action.url } };
|
|
4152
4173
|
case "find":
|
|
@@ -4527,7 +4548,7 @@ var OpenAITranscriptionModel = class {
|
|
|
4527
4548
|
};
|
|
4528
4549
|
|
|
4529
4550
|
// src/version.ts
|
|
4530
|
-
var VERSION = true ? "2.0.
|
|
4551
|
+
var VERSION = true ? "2.0.56" : "0.0.0-test";
|
|
4531
4552
|
|
|
4532
4553
|
// src/openai-provider.ts
|
|
4533
4554
|
function createOpenAI(options = {}) {
|