Major Changes
-
61753c3: ###
@ai-sdk/openai: remove redundantnameargument fromopenai.tools.customTool()openai.tools.customTool()no longer accepts anamefield. the tool name is now derived from the sdk tool key (the object key in thetoolsobject).migration: remove the
nameproperty fromcustomTool()calls. the object key is now used as the tool name sent to the openai api.before:
tools: { write_sql: openai.tools.customTool({ name: 'write_sql', description: '...', }), }after:
tools: { write_sql: openai.tools.customTool({ description: '...', }), }@ai-sdk/provider-utils:createToolNameMapping()no longer accepts theresolveProviderToolNameparameterbefore: tool name can be set dynamically
const toolNameMapping = createToolNameMapping({ tools, providerToolNames: { 'openai.code_interpreter': 'code_interpreter', 'openai.file_search': 'file_search', 'openai.image_generation': 'image_generation', 'openai.local_shell': 'local_shell', 'openai.shell': 'shell', 'openai.web_search': 'web_search', 'openai.web_search_preview': 'web_search_preview', 'openai.mcp': 'mcp', 'openai.apply_patch': 'apply_patch', }, resolveProviderToolName: tool => tool.id === 'openai.custom' ? (tool.args as { name?: string }).name : undefined, });after: tool name is static based on
toolskeysconst toolNameMapping = createToolNameMapping({ tools, providerToolNames: { 'openai.code_interpreter': 'code_interpreter', 'openai.file_search': 'file_search', 'openai.image_generation': 'image_generation', 'openai.local_shell': 'local_shell', 'openai.shell': 'shell', 'openai.web_search': 'web_search', 'openai.web_search_preview': 'web_search_preview', 'openai.mcp': 'mcp', 'openai.apply_patch': 'apply_patch', } });