@ai-sdk/openai 3.0.65 → 3.0.67
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 +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +196 -1
- package/dist/internal/index.d.ts +196 -1
- package/dist/internal/index.js +20 -4
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +15 -3
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/internal/index.ts +1 -0
- package/src/responses/openai-responses-api.ts +2 -0
- package/src/responses/openai-responses-language-model.ts +5 -1
- package/src/tool/web-search.ts +8 -0
package/package.json
CHANGED
package/src/internal/index.ts
CHANGED
|
@@ -738,6 +738,7 @@ export const openaiResponsesChunkSchema = lazySchema(() =>
|
|
|
738
738
|
z.object({
|
|
739
739
|
type: z.literal('search'),
|
|
740
740
|
query: z.string().nullish(),
|
|
741
|
+
queries: z.array(z.string()).nullish(),
|
|
741
742
|
sources: z
|
|
742
743
|
.array(
|
|
743
744
|
z.discriminatedUnion('type', [
|
|
@@ -1130,6 +1131,7 @@ export const openaiResponsesResponseSchema = lazySchema(() =>
|
|
|
1130
1131
|
z.object({
|
|
1131
1132
|
type: z.literal('search'),
|
|
1132
1133
|
query: z.string().nullish(),
|
|
1134
|
+
queries: z.array(z.string()).nullish(),
|
|
1133
1135
|
sources: z
|
|
1134
1136
|
.array(
|
|
1135
1137
|
z.discriminatedUnion('type', [
|
|
@@ -2247,7 +2247,11 @@ function mapWebSearchOutput(
|
|
|
2247
2247
|
switch (action.type) {
|
|
2248
2248
|
case 'search':
|
|
2249
2249
|
return {
|
|
2250
|
-
action: {
|
|
2250
|
+
action: {
|
|
2251
|
+
type: 'search',
|
|
2252
|
+
query: action.query ?? undefined,
|
|
2253
|
+
...(action.queries != null && { queries: action.queries }),
|
|
2254
|
+
},
|
|
2251
2255
|
// include sources when provided by the Responses API (behind include flag)
|
|
2252
2256
|
...(action.sources != null && { sources: action.sources }),
|
|
2253
2257
|
};
|
package/src/tool/web-search.ts
CHANGED
|
@@ -36,6 +36,7 @@ export const webSearchOutputSchema = lazySchema(() =>
|
|
|
36
36
|
z.object({
|
|
37
37
|
type: z.literal('search'),
|
|
38
38
|
query: z.string().optional(),
|
|
39
|
+
queries: z.array(z.string()).optional(),
|
|
39
40
|
}),
|
|
40
41
|
z.object({
|
|
41
42
|
type: z.literal('openPage'),
|
|
@@ -78,8 +79,15 @@ export const webSearchToolFactory = createProviderToolFactoryWithOutputSchema<
|
|
|
78
79
|
|
|
79
80
|
/**
|
|
80
81
|
* The search query.
|
|
82
|
+
*
|
|
83
|
+
* @deprecated Use `queries` instead.
|
|
81
84
|
*/
|
|
82
85
|
query?: string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The search queries the model used.
|
|
89
|
+
*/
|
|
90
|
+
queries?: string[];
|
|
83
91
|
}
|
|
84
92
|
| {
|
|
85
93
|
/**
|