@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/internal/index.mjs
CHANGED
|
@@ -2639,7 +2639,8 @@ var openaiResponsesChunkSchema = lazyValidator11(
|
|
|
2639
2639
|
action: z14.discriminatedUnion("type", [
|
|
2640
2640
|
z14.object({
|
|
2641
2641
|
type: z14.literal("search"),
|
|
2642
|
-
query: z14.string().nullish()
|
|
2642
|
+
query: z14.string().nullish(),
|
|
2643
|
+
sources: z14.array(z14.object({ type: z14.literal("url"), url: z14.string() })).nullish()
|
|
2643
2644
|
}),
|
|
2644
2645
|
z14.object({
|
|
2645
2646
|
type: z14.literal("open_page"),
|
|
@@ -2825,7 +2826,8 @@ var openaiResponsesResponseSchema = lazyValidator11(
|
|
|
2825
2826
|
action: z14.discriminatedUnion("type", [
|
|
2826
2827
|
z14.object({
|
|
2827
2828
|
type: z14.literal("search"),
|
|
2828
|
-
query: z14.string().nullish()
|
|
2829
|
+
query: z14.string().nullish(),
|
|
2830
|
+
sources: z14.array(z14.object({ type: z14.literal("url"), url: z14.string() })).nullish()
|
|
2829
2831
|
}),
|
|
2830
2832
|
z14.object({
|
|
2831
2833
|
type: z14.literal("open_page"),
|
|
@@ -3179,7 +3181,8 @@ var webSearchOutputSchema = lazySchema4(
|
|
|
3179
3181
|
url: z18.string(),
|
|
3180
3182
|
pattern: z18.string()
|
|
3181
3183
|
})
|
|
3182
|
-
])
|
|
3184
|
+
]),
|
|
3185
|
+
sources: z18.array(z18.object({ type: z18.literal("url"), url: z18.string() })).optional()
|
|
3183
3186
|
})
|
|
3184
3187
|
)
|
|
3185
3188
|
);
|
|
@@ -3760,7 +3763,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3760
3763
|
id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : generateId2(),
|
|
3761
3764
|
mediaType: "text/plain",
|
|
3762
3765
|
title: (_k = (_j = annotation.quote) != null ? _j : annotation.filename) != null ? _k : "Document",
|
|
3763
|
-
filename: (_l = annotation.filename) != null ? _l : annotation.file_id
|
|
3766
|
+
filename: (_l = annotation.filename) != null ? _l : annotation.file_id,
|
|
3767
|
+
...annotation.file_id ? {
|
|
3768
|
+
providerMetadata: {
|
|
3769
|
+
openai: {
|
|
3770
|
+
fileId: annotation.file_id
|
|
3771
|
+
}
|
|
3772
|
+
}
|
|
3773
|
+
} : {}
|
|
3764
3774
|
});
|
|
3765
3775
|
}
|
|
3766
3776
|
}
|
|
@@ -4338,7 +4348,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4338
4348
|
id: (_s = (_r = (_q = self.config).generateId) == null ? void 0 : _r.call(_q)) != null ? _s : generateId2(),
|
|
4339
4349
|
mediaType: "text/plain",
|
|
4340
4350
|
title: (_u = (_t = value.annotation.quote) != null ? _t : value.annotation.filename) != null ? _u : "Document",
|
|
4341
|
-
filename: (_v = value.annotation.filename) != null ? _v : value.annotation.file_id
|
|
4351
|
+
filename: (_v = value.annotation.filename) != null ? _v : value.annotation.file_id,
|
|
4352
|
+
...value.annotation.file_id ? {
|
|
4353
|
+
providerMetadata: {
|
|
4354
|
+
openai: {
|
|
4355
|
+
fileId: value.annotation.file_id
|
|
4356
|
+
}
|
|
4357
|
+
}
|
|
4358
|
+
} : {}
|
|
4342
4359
|
});
|
|
4343
4360
|
}
|
|
4344
4361
|
} else if (isErrorChunk(value)) {
|
|
@@ -4438,7 +4455,11 @@ function mapWebSearchOutput(action) {
|
|
|
4438
4455
|
var _a;
|
|
4439
4456
|
switch (action.type) {
|
|
4440
4457
|
case "search":
|
|
4441
|
-
return {
|
|
4458
|
+
return {
|
|
4459
|
+
action: { type: "search", query: (_a = action.query) != null ? _a : void 0 },
|
|
4460
|
+
// include sources when provided by the Responses API (behind include flag)
|
|
4461
|
+
...action.sources != null && { sources: action.sources }
|
|
4462
|
+
};
|
|
4442
4463
|
case "open_page":
|
|
4443
4464
|
return { action: { type: "openPage", url: action.url } };
|
|
4444
4465
|
case "find":
|