@ai-sdk/openai 2.0.137 → 2.0.138
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 +7 -0
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +8 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +8 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @ai-sdk/openai
|
|
2
2
|
|
|
3
|
+
## 2.0.138
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1ff7951: fix(openai): report unfinished web searches as tool errors
|
|
8
|
+
- 1ff7951: Report failed and incomplete web searches as tool errors instead of successful tool results in OpenAI Responses API calls.
|
|
9
|
+
|
|
3
10
|
## 2.0.137
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -4163,7 +4163,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4163
4163
|
type: "tool-result",
|
|
4164
4164
|
toolCallId: part.id,
|
|
4165
4165
|
toolName: webSearchToolName != null ? webSearchToolName : "web_search",
|
|
4166
|
-
|
|
4166
|
+
...mapWebSearchResult(part),
|
|
4167
4167
|
providerExecuted: true
|
|
4168
4168
|
});
|
|
4169
4169
|
break;
|
|
@@ -4495,7 +4495,7 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
4495
4495
|
type: "tool-result",
|
|
4496
4496
|
toolCallId: value.item.id,
|
|
4497
4497
|
toolName: webSearchToolName != null ? webSearchToolName : "web_search",
|
|
4498
|
-
|
|
4498
|
+
...mapWebSearchResult(value.item),
|
|
4499
4499
|
providerExecuted: true
|
|
4500
4500
|
});
|
|
4501
4501
|
} else if (value.item.type === "computer_call") {
|
|
@@ -4824,6 +4824,12 @@ function isResponseAnnotationAddedChunk(chunk) {
|
|
|
4824
4824
|
function isErrorChunk(chunk) {
|
|
4825
4825
|
return chunk.type === "error";
|
|
4826
4826
|
}
|
|
4827
|
+
function mapWebSearchResult({
|
|
4828
|
+
action,
|
|
4829
|
+
status
|
|
4830
|
+
}) {
|
|
4831
|
+
return status === "completed" ? { result: mapWebSearchOutput(action) } : { isError: true, result: { status } };
|
|
4832
|
+
}
|
|
4827
4833
|
function mapWebSearchOutput(action) {
|
|
4828
4834
|
var _a2;
|
|
4829
4835
|
if (action == null) {
|
|
@@ -5226,7 +5232,7 @@ var OpenAITranscriptionModel = class {
|
|
|
5226
5232
|
};
|
|
5227
5233
|
|
|
5228
5234
|
// src/version.ts
|
|
5229
|
-
var VERSION = true ? "2.0.
|
|
5235
|
+
var VERSION = true ? "2.0.138" : "0.0.0-test";
|
|
5230
5236
|
|
|
5231
5237
|
// src/openai-provider.ts
|
|
5232
5238
|
function createOpenAI(options = {}) {
|