@ai-sdk/openai 2.0.0-beta.6 → 2.0.0-beta.7

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,11 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 2.0.0-beta.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 209256d: Add missing file_search tool support to OpenAI Responses API
8
+
3
9
  ## 2.0.0-beta.6
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -2103,6 +2103,16 @@ function prepareResponsesTools({
2103
2103
  break;
2104
2104
  case "provider-defined":
2105
2105
  switch (tool.id) {
2106
+ case "openai.file_search": {
2107
+ const args = fileSearchArgsSchema.parse(tool.args);
2108
+ openaiTools2.push({
2109
+ type: "file_search",
2110
+ vector_store_ids: args.vectorStoreIds,
2111
+ max_results: args.maxResults,
2112
+ search_type: args.searchType
2113
+ });
2114
+ break;
2115
+ }
2106
2116
  case "openai.web_search_preview":
2107
2117
  openaiTools2.push({
2108
2118
  type: "web_search_preview",
@@ -2132,7 +2142,7 @@ function prepareResponsesTools({
2132
2142
  case "tool":
2133
2143
  return {
2134
2144
  tools: openaiTools2,
2135
- toolChoice: toolChoice.toolName === "web_search_preview" ? { type: "web_search_preview" } : { type: "function", name: toolChoice.toolName },
2145
+ toolChoice: toolChoice.toolName === "file_search" ? { type: "file_search" } : toolChoice.toolName === "web_search_preview" ? { type: "web_search_preview" } : { type: "function", name: toolChoice.toolName },
2136
2146
  toolWarnings
2137
2147
  };
2138
2148
  default: {