@ai-sdk/openai 2.0.84 → 2.0.86
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 +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +27 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -19
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +3 -3
- package/dist/internal/index.d.ts +3 -3
- package/dist/internal/index.js +26 -18
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +26 -18
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -491,7 +491,7 @@ declare const webSearchPreviewInputSchema: _ai_sdk_provider_utils.LazySchema<Rec
|
|
|
491
491
|
declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
|
|
492
492
|
/**
|
|
493
493
|
* An object describing the specific action taken in this web search call.
|
|
494
|
-
* Includes details on how the model used the web (search, open_page,
|
|
494
|
+
* Includes details on how the model used the web (search, open_page, findInPage).
|
|
495
495
|
*/
|
|
496
496
|
action: {
|
|
497
497
|
/**
|
|
@@ -513,9 +513,9 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactor
|
|
|
513
513
|
url?: string | null;
|
|
514
514
|
} | {
|
|
515
515
|
/**
|
|
516
|
-
* Action type "
|
|
516
|
+
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
517
517
|
*/
|
|
518
|
-
type: "
|
|
518
|
+
type: "findInPage";
|
|
519
519
|
/**
|
|
520
520
|
* The URL of the page searched for the pattern.
|
|
521
521
|
*/
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -491,7 +491,7 @@ declare const webSearchPreviewInputSchema: _ai_sdk_provider_utils.LazySchema<Rec
|
|
|
491
491
|
declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{}, {
|
|
492
492
|
/**
|
|
493
493
|
* An object describing the specific action taken in this web search call.
|
|
494
|
-
* Includes details on how the model used the web (search, open_page,
|
|
494
|
+
* Includes details on how the model used the web (search, open_page, findInPage).
|
|
495
495
|
*/
|
|
496
496
|
action: {
|
|
497
497
|
/**
|
|
@@ -513,9 +513,9 @@ declare const webSearchPreview: _ai_sdk_provider_utils.ProviderDefinedToolFactor
|
|
|
513
513
|
url?: string | null;
|
|
514
514
|
} | {
|
|
515
515
|
/**
|
|
516
|
-
* Action type "
|
|
516
|
+
* Action type "findInPage": Searches for a pattern within a loaded page.
|
|
517
517
|
*/
|
|
518
|
-
type: "
|
|
518
|
+
type: "findInPage";
|
|
519
519
|
/**
|
|
520
520
|
* The URL of the page searched for the pattern.
|
|
521
521
|
*/
|
package/dist/internal/index.js
CHANGED
|
@@ -325,10 +325,12 @@ var openaiChatResponseSchema = (0, import_provider_utils3.lazyValidator)(
|
|
|
325
325
|
annotations: import_v42.z.array(
|
|
326
326
|
import_v42.z.object({
|
|
327
327
|
type: import_v42.z.literal("url_citation"),
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
328
|
+
url_citation: import_v42.z.object({
|
|
329
|
+
start_index: import_v42.z.number(),
|
|
330
|
+
end_index: import_v42.z.number(),
|
|
331
|
+
url: import_v42.z.string(),
|
|
332
|
+
title: import_v42.z.string()
|
|
333
|
+
})
|
|
332
334
|
})
|
|
333
335
|
).nullish()
|
|
334
336
|
}),
|
|
@@ -392,10 +394,12 @@ var openaiChatChunkSchema = (0, import_provider_utils3.lazyValidator)(
|
|
|
392
394
|
annotations: import_v42.z.array(
|
|
393
395
|
import_v42.z.object({
|
|
394
396
|
type: import_v42.z.literal("url_citation"),
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
397
|
+
url_citation: import_v42.z.object({
|
|
398
|
+
start_index: import_v42.z.number(),
|
|
399
|
+
end_index: import_v42.z.number(),
|
|
400
|
+
url: import_v42.z.string(),
|
|
401
|
+
title: import_v42.z.string()
|
|
402
|
+
})
|
|
399
403
|
})
|
|
400
404
|
).nullish()
|
|
401
405
|
}).nullish(),
|
|
@@ -849,8 +853,8 @@ var OpenAIChatLanguageModel = class {
|
|
|
849
853
|
type: "source",
|
|
850
854
|
sourceType: "url",
|
|
851
855
|
id: (0, import_provider_utils5.generateId)(),
|
|
852
|
-
url: annotation.url,
|
|
853
|
-
title: annotation.title
|
|
856
|
+
url: annotation.url_citation.url,
|
|
857
|
+
title: annotation.url_citation.title
|
|
854
858
|
});
|
|
855
859
|
}
|
|
856
860
|
const completionTokenDetails = (_d = response.usage) == null ? void 0 : _d.completion_tokens_details;
|
|
@@ -1079,8 +1083,8 @@ var OpenAIChatLanguageModel = class {
|
|
|
1079
1083
|
type: "source",
|
|
1080
1084
|
sourceType: "url",
|
|
1081
1085
|
id: (0, import_provider_utils5.generateId)(),
|
|
1082
|
-
url: annotation.url,
|
|
1083
|
-
title: annotation.title
|
|
1086
|
+
url: annotation.url_citation.url,
|
|
1087
|
+
title: annotation.url_citation.title
|
|
1084
1088
|
});
|
|
1085
1089
|
}
|
|
1086
1090
|
}
|
|
@@ -2617,7 +2621,7 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazyValidator)(
|
|
|
2617
2621
|
url: import_v414.z.string().nullish()
|
|
2618
2622
|
}),
|
|
2619
2623
|
import_v414.z.object({
|
|
2620
|
-
type: import_v414.z.literal("
|
|
2624
|
+
type: import_v414.z.literal("find_in_page"),
|
|
2621
2625
|
url: import_v414.z.string().nullish(),
|
|
2622
2626
|
pattern: import_v414.z.string().nullish()
|
|
2623
2627
|
})
|
|
@@ -2827,7 +2831,7 @@ var openaiResponsesResponseSchema = (0, import_provider_utils21.lazyValidator)(
|
|
|
2827
2831
|
url: import_v414.z.string().nullish()
|
|
2828
2832
|
}),
|
|
2829
2833
|
import_v414.z.object({
|
|
2830
|
-
type: import_v414.z.literal("
|
|
2834
|
+
type: import_v414.z.literal("find_in_page"),
|
|
2831
2835
|
url: import_v414.z.string().nullish(),
|
|
2832
2836
|
pattern: import_v414.z.string().nullish()
|
|
2833
2837
|
})
|
|
@@ -3189,7 +3193,7 @@ var webSearchOutputSchema = (0, import_provider_utils25.lazySchema)(
|
|
|
3189
3193
|
url: import_v418.z.string().nullish()
|
|
3190
3194
|
}),
|
|
3191
3195
|
import_v418.z.object({
|
|
3192
|
-
type: import_v418.z.literal("
|
|
3196
|
+
type: import_v418.z.literal("findInPage"),
|
|
3193
3197
|
url: import_v418.z.string().nullish(),
|
|
3194
3198
|
pattern: import_v418.z.string().nullish()
|
|
3195
3199
|
})
|
|
@@ -3243,7 +3247,7 @@ var webSearchPreviewOutputSchema = (0, import_provider_utils26.lazySchema)(
|
|
|
3243
3247
|
url: import_v419.z.string().nullish()
|
|
3244
3248
|
}),
|
|
3245
3249
|
import_v419.z.object({
|
|
3246
|
-
type: import_v419.z.literal("
|
|
3250
|
+
type: import_v419.z.literal("findInPage"),
|
|
3247
3251
|
url: import_v419.z.string().nullish(),
|
|
3248
3252
|
pattern: import_v419.z.string().nullish()
|
|
3249
3253
|
})
|
|
@@ -4499,9 +4503,13 @@ function mapWebSearchOutput(action) {
|
|
|
4499
4503
|
};
|
|
4500
4504
|
case "open_page":
|
|
4501
4505
|
return { action: { type: "openPage", url: action.url } };
|
|
4502
|
-
case "
|
|
4506
|
+
case "find_in_page":
|
|
4503
4507
|
return {
|
|
4504
|
-
action: {
|
|
4508
|
+
action: {
|
|
4509
|
+
type: "findInPage",
|
|
4510
|
+
url: action.url,
|
|
4511
|
+
pattern: action.pattern
|
|
4512
|
+
}
|
|
4505
4513
|
};
|
|
4506
4514
|
}
|
|
4507
4515
|
}
|