feat: 注册 git_status, git_diff, git_commit 工具定义

This commit is contained in:
scorpio 2026-03-10 09:40:47 +08:00
parent cbbb7d399d
commit a41c4f3d08

View File

@ -127,4 +127,39 @@ var FileTools = []openai.Tool{
}`, }`,
}, },
}, },
{
Type: openai.ToolTypeFunction,
Function: &openai.FunctionDefinition{
Name: "git_status",
Description: "查看 Git 工作区状态",
Parameters: `{"type": "object", "properties": {}}`,
},
},
{
Type: openai.ToolTypeFunction,
Function: &openai.FunctionDefinition{
Name: "git_diff",
Description: "查看文件变更",
Parameters: `{
"type": "object",
"properties": {
"filename": {"type": "string", "description": "文件名"}
}
}`,
},
},
{
Type: openai.ToolTypeFunction,
Function: &openai.FunctionDefinition{
Name: "git_commit",
Description: "提交更改",
Parameters: `{
"type": "object",
"properties": {
"message": {"type": "string", "description": "提交信息"}
},
"required": ["message"]
}`,
},
},
} }