Open History to see the last commit
1import { openAIProviderTool } from './openai-provider-tool'
2import type { ApplyPatchTool as ApplyPatchToolConfig } from 'openai/resources/responses/responses'
3import type { Tool } from '@tanstack/ai'
4
5export type { ApplyPatchToolConfig }
6
7/**
8 * Converts a standard Tool to OpenAI ApplyPatchTool format
9 */
10export function convertApplyPatchToolToAdapterFormat(
11 _tool: Tool,
12): ApplyPatchToolConfig {
13 return {
14 type: 'apply_patch',
15 }
16}
17
18/**
19 * Creates a standard Tool from ApplyPatchTool parameters.
20 *
21 * Base (non-branded) factory. Providers that need branded return types should
22 * re-wrap this in their own package.
23 */
24export function applyPatchTool(): Tool {
25 return openAIProviderTool(
26 {
27 name: 'apply_patch',
28 description: 'Apply a patch to modify files',
29 metadata: {},
30 },
31 'apply_patch',
32 )
33}