@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.
@@ -1813,7 +1813,16 @@ function prepareResponsesTools({
1813
1813
  case "none":
1814
1814
  case "required":
1815
1815
  return { tools: openaiTools, tool_choice: type, toolWarnings };
1816
- case "tool":
1816
+ case "tool": {
1817
+ if (toolChoice.toolName === "web_search_preview") {
1818
+ return {
1819
+ tools: openaiTools,
1820
+ tool_choice: {
1821
+ type: "web_search_preview"
1822
+ },
1823
+ toolWarnings
1824
+ };
1825
+ }
1817
1826
  return {
1818
1827
  tools: openaiTools,
1819
1828
  tool_choice: {
@@ -1822,6 +1831,7 @@ function prepareResponsesTools({
1822
1831
  },
1823
1832
  toolWarnings
1824
1833
  };
1834
+ }
1825
1835
  default: {
1826
1836
  const _exhaustiveCheck = type;
1827
1837
  throw new UnsupportedFunctionalityError7({