@ai-sdk/openai 1.3.4 → 1.3.5

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,13 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 1.3.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 52ed95f: fix (provider/openai): force web search tool
8
+ - Updated dependencies [b01120e]
9
+ - @ai-sdk/provider-utils@2.2.2
10
+
3
11
  ## 1.3.4
4
12
 
5
13
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1798,7 +1798,16 @@ function prepareResponsesTools({
1798
1798
  case "none":
1799
1799
  case "required":
1800
1800
  return { tools: openaiTools2, tool_choice: type, toolWarnings };
1801
- case "tool":
1801
+ case "tool": {
1802
+ if (toolChoice.toolName === "web_search_preview") {
1803
+ return {
1804
+ tools: openaiTools2,
1805
+ tool_choice: {
1806
+ type: "web_search_preview"
1807
+ },
1808
+ toolWarnings
1809
+ };
1810
+ }
1802
1811
  return {
1803
1812
  tools: openaiTools2,
1804
1813
  tool_choice: {
@@ -1807,6 +1816,7 @@ function prepareResponsesTools({
1807
1816
  },
1808
1817
  toolWarnings
1809
1818
  };
1819
+ }
1810
1820
  default: {
1811
1821
  const _exhaustiveCheck = type;
1812
1822
  throw new import_provider8.UnsupportedFunctionalityError({