@ai-sdk/openai 2.0.137 → 2.0.139

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 2.0.139
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [a1a772f]
8
+ - @ai-sdk/provider-utils@3.0.43
9
+
10
+ ## 2.0.138
11
+
12
+ ### Patch Changes
13
+
14
+ - 1ff7951: fix(openai): report unfinished web searches as tool errors
15
+ - 1ff7951: Report failed and incomplete web searches as tool errors instead of successful tool results in OpenAI Responses API calls.
16
+
3
17
  ## 2.0.137
4
18
 
5
19
  ### 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
- result: mapWebSearchOutput(part.action),
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
- result: mapWebSearchOutput(value.item.action),
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.137" : "0.0.0-test";
5235
+ var VERSION = true ? "2.0.139" : "0.0.0-test";
5230
5236
 
5231
5237
  // src/openai-provider.ts
5232
5238
  function createOpenAI(options = {}) {