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