@ai-sdk/openai 2.0.71 → 2.0.73
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 +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +18 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -16
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +17 -15
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +17 -15
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 2.0.73
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2e2fd83: refactoring(provider/openai): simplify code
|
|
8
|
+
|
|
9
|
+
## 2.0.72
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 53d2fcc: added support for external_web_access parameter on web_search tool
|
|
14
|
+
|
|
3
15
|
## 2.0.71
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -77,6 +77,12 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFa
|
|
|
77
77
|
name: string;
|
|
78
78
|
}>;
|
|
79
79
|
}, {
|
|
80
|
+
/**
|
|
81
|
+
* Whether to use external web access for fetching live content.
|
|
82
|
+
* - true: Fetch live web content (default)
|
|
83
|
+
* - false: Use cached/indexed results
|
|
84
|
+
*/
|
|
85
|
+
externalWebAccess?: boolean;
|
|
80
86
|
/**
|
|
81
87
|
* Filters for the search.
|
|
82
88
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -77,6 +77,12 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderDefinedToolFa
|
|
|
77
77
|
name: string;
|
|
78
78
|
}>;
|
|
79
79
|
}, {
|
|
80
|
+
/**
|
|
81
|
+
* Whether to use external web access for fetching live content.
|
|
82
|
+
* - true: Fetch live web content (default)
|
|
83
|
+
* - false: Use cached/indexed results
|
|
84
|
+
*/
|
|
85
|
+
externalWebAccess?: boolean;
|
|
80
86
|
/**
|
|
81
87
|
* Filters for the search.
|
|
82
88
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1917,6 +1917,7 @@ var import_v413 = require("zod/v4");
|
|
|
1917
1917
|
var webSearchArgsSchema = (0, import_provider_utils18.lazySchema)(
|
|
1918
1918
|
() => (0, import_provider_utils18.zodSchema)(
|
|
1919
1919
|
import_v413.z.object({
|
|
1920
|
+
externalWebAccess: import_v413.z.boolean().optional(),
|
|
1920
1921
|
filters: import_v413.z.object({ allowedDomains: import_v413.z.array(import_v413.z.string()).optional() }).optional(),
|
|
1921
1922
|
searchContextSize: import_v413.z.enum(["low", "medium", "high"]).optional(),
|
|
1922
1923
|
userLocation: import_v413.z.object({
|
|
@@ -3044,6 +3045,7 @@ async function prepareResponsesTools({
|
|
|
3044
3045
|
openaiTools2.push({
|
|
3045
3046
|
type: "web_search",
|
|
3046
3047
|
filters: args.filters != null ? { allowed_domains: args.filters.allowedDomains } : void 0,
|
|
3048
|
+
external_web_access: args.externalWebAccess,
|
|
3047
3049
|
search_context_size: args.searchContextSize,
|
|
3048
3050
|
user_location: args.userLocation
|
|
3049
3051
|
});
|
|
@@ -3776,8 +3778,21 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3776
3778
|
}
|
|
3777
3779
|
});
|
|
3778
3780
|
}
|
|
3779
|
-
} else if (isResponseOutputItemDoneChunk(value)
|
|
3780
|
-
if (value.item.type === "
|
|
3781
|
+
} else if (isResponseOutputItemDoneChunk(value)) {
|
|
3782
|
+
if (value.item.type === "message") {
|
|
3783
|
+
controller.enqueue({
|
|
3784
|
+
type: "text-end",
|
|
3785
|
+
id: value.item.id,
|
|
3786
|
+
providerMetadata: {
|
|
3787
|
+
openai: {
|
|
3788
|
+
itemId: value.item.id,
|
|
3789
|
+
...ongoingAnnotations.length > 0 && {
|
|
3790
|
+
annotations: ongoingAnnotations
|
|
3791
|
+
}
|
|
3792
|
+
}
|
|
3793
|
+
}
|
|
3794
|
+
});
|
|
3795
|
+
} else if (value.item.type === "function_call") {
|
|
3781
3796
|
ongoingToolCalls[value.output_index] = void 0;
|
|
3782
3797
|
hasFunctionCall = true;
|
|
3783
3798
|
controller.enqueue({
|
|
@@ -4058,19 +4073,6 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4058
4073
|
} : {}
|
|
4059
4074
|
});
|
|
4060
4075
|
}
|
|
4061
|
-
} else if (isResponseOutputItemDoneChunk(value) && value.item.type === "message") {
|
|
4062
|
-
controller.enqueue({
|
|
4063
|
-
type: "text-end",
|
|
4064
|
-
id: value.item.id,
|
|
4065
|
-
providerMetadata: {
|
|
4066
|
-
openai: {
|
|
4067
|
-
itemId: value.item.id,
|
|
4068
|
-
...ongoingAnnotations.length > 0 && {
|
|
4069
|
-
annotations: ongoingAnnotations
|
|
4070
|
-
}
|
|
4071
|
-
}
|
|
4072
|
-
}
|
|
4073
|
-
});
|
|
4074
4076
|
} else if (isErrorChunk(value)) {
|
|
4075
4077
|
controller.enqueue({ type: "error", error: value });
|
|
4076
4078
|
}
|
|
@@ -4528,7 +4530,7 @@ var OpenAITranscriptionModel = class {
|
|
|
4528
4530
|
};
|
|
4529
4531
|
|
|
4530
4532
|
// src/version.ts
|
|
4531
|
-
var VERSION = true ? "2.0.
|
|
4533
|
+
var VERSION = true ? "2.0.73" : "0.0.0-test";
|
|
4532
4534
|
|
|
4533
4535
|
// src/openai-provider.ts
|
|
4534
4536
|
function createOpenAI(options = {}) {
|