@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.
@@ -4546,7 +4546,7 @@ var OpenAIResponsesLanguageModel = class {
4546
4546
  type: "tool-result",
4547
4547
  toolCallId: part.id,
4548
4548
  toolName: webSearchToolName != null ? webSearchToolName : "web_search",
4549
- result: mapWebSearchOutput(part.action),
4549
+ ...mapWebSearchResult(part),
4550
4550
  providerExecuted: true
4551
4551
  });
4552
4552
  break;
@@ -4878,7 +4878,7 @@ var OpenAIResponsesLanguageModel = class {
4878
4878
  type: "tool-result",
4879
4879
  toolCallId: value.item.id,
4880
4880
  toolName: webSearchToolName != null ? webSearchToolName : "web_search",
4881
- result: mapWebSearchOutput(value.item.action),
4881
+ ...mapWebSearchResult(value.item),
4882
4882
  providerExecuted: true
4883
4883
  });
4884
4884
  } else if (value.item.type === "computer_call") {
@@ -5207,6 +5207,12 @@ function isResponseAnnotationAddedChunk(chunk) {
5207
5207
  function isErrorChunk(chunk) {
5208
5208
  return chunk.type === "error";
5209
5209
  }
5210
+ function mapWebSearchResult({
5211
+ action,
5212
+ status
5213
+ }) {
5214
+ return status === "completed" ? { result: mapWebSearchOutput(action) } : { isError: true, result: { status } };
5215
+ }
5210
5216
  function mapWebSearchOutput(action) {
5211
5217
  var _a2;
5212
5218
  if (action == null) {