Open History to see the last commit
1import { computerUseTool as baseComputerUseTool } from '@tanstack/openai-base'
2import type { ProviderTool } from '@tanstack/ai'
3import type { ComputerUseToolConfig } from '@tanstack/openai-base'
4
5export {
6 type ComputerUseToolConfig,
7 convertComputerUseToolToAdapterFormat,
8} from '@tanstack/openai-base'
9
10// The brand discriminator (`computer_use`) intentionally differs from the
11// runtime tool name (`computer`). The brand matches
12// the model-meta tool-capability union (`tools: ['computer_use', ...]`) used to
13// gate which models can construct this tool at compile time, while the runtime
14// name matches the tool type in the OpenAI SDK. The base factory records the
15// canonical `computer_use` kind separately in adapter metadata.
16export type OpenAIComputerUseTool = ProviderTool<'openai', 'computer_use'>
17
18/**
19 * Creates a standard Tool from ComputerUseToolConfig parameters, branded as an
20 * OpenAI provider tool.
21 */
22export function computerUseTool(
23 toolData: ComputerUseToolConfig,
24): OpenAIComputerUseTool {
25 return baseComputerUseTool(toolData) as OpenAIComputerUseTool
26}