-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
Description
Inspection of the ai sdk open ai package shows that while prepareTool function allows file search tool calling:
switch (tool.id) {
case 'openai.file_search': {
const args = fileSearchArgsSchema.parse(tool.args);
openaiTools.push({
type: 'file_search',
vector_store_ids: args.vectorStoreIds,
max_results: args.maxResults,
search_type: args.searchType,
});
break;
}
case 'openai.web_search_preview': {
const args = webSearchPreviewArgsSchema.parse(tool.args);
openaiTools.push({
type: 'web_search_preview',
search_context_size: args.searchContextSize,
user_location: args.userLocation,
});
break;
}
default:
toolWarnings.push({ type: 'unsupported-tool', tool });
break;
}
The prepareResponsesTools will treat the file search tool as unsupported
packages/openai/src/responses/openai-responses-prepare-tools.ts:
case 'provider-defined':
switch (tool.id) {
case 'openai.web_search_preview':
openaiTools.push({
type: 'web_search_preview',
search_context_size: tool.args.searchContextSize as
| 'low'
| 'medium'
| 'high',
user_location: tool.args.userLocation as {
type: 'approximate';
city: string;
region: string;
},
});
break;
default:
toolWarnings.push({ type: 'unsupported-tool', tool });
break;
}
This is just one example of the lack of support
AI SDK Version
"@ai-sdk/openai": "2.0.0-beta.6"
"@ai-sdk/react": "2.0.0-beta.6"
"ai": "5.0.0-beta.6"
nneven, siddartha-10, KranthiGV and lusentis