@ai-sdk/openai 3.0.133 → 3.0.134

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/openai",
3
- "version": "3.0.133",
3
+ "version": "3.0.134",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -44,8 +44,8 @@
44
44
  "tsup": "^8",
45
45
  "typescript": "5.8.3",
46
46
  "zod": "3.25.76",
47
- "@ai-sdk/test-server": "1.0.6",
48
- "@vercel/ai-tsconfig": "0.0.0"
47
+ "@vercel/ai-tsconfig": "0.0.0",
48
+ "@ai-sdk/test-server": "1.0.6"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "zod": "^3.25.76 || ^4.1.8"
@@ -1009,7 +1009,7 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV3 {
1009
1009
  toolName: toolNameMapping.toCustomToolName(
1010
1010
  webSearchToolName ?? 'web_search',
1011
1011
  ),
1012
- result: mapWebSearchOutput(part.action),
1012
+ ...mapWebSearchResult(part),
1013
1013
  });
1014
1014
 
1015
1015
  break;
@@ -1772,7 +1772,7 @@ export class OpenAIResponsesLanguageModel implements LanguageModelV3 {
1772
1772
  toolName: toolNameMapping.toCustomToolName(
1773
1773
  webSearchToolName ?? 'web_search',
1774
1774
  ),
1775
- result: mapWebSearchOutput(value.item.action),
1775
+ ...mapWebSearchResult(value.item),
1776
1776
  });
1777
1777
  } else if (value.item.type === 'computer_call') {
1778
1778
  ongoingToolCalls[value.output_index] = undefined;
@@ -2678,6 +2678,20 @@ function isResponseOutputChunk(chunk: OpenAIResponsesChunk): boolean {
2678
2678
  );
2679
2679
  }
2680
2680
 
2681
+ export function mapWebSearchResult({
2682
+ action,
2683
+ status,
2684
+ }: {
2685
+ action?: OpenAIResponsesWebSearchAction | null;
2686
+ status: string;
2687
+ }):
2688
+ | { isError: true; result: { status: string } }
2689
+ | { result: InferSchema<typeof webSearchOutputSchema> } {
2690
+ return status === 'completed'
2691
+ ? { result: mapWebSearchOutput(action) }
2692
+ : { isError: true, result: { status } };
2693
+ }
2694
+
2681
2695
  function mapWebSearchOutput(
2682
2696
  action: OpenAIResponsesWebSearchAction | null | undefined,
2683
2697
  ): InferSchema<typeof webSearchOutputSchema> {