From a41c4f3d089b46e07c6197c4c02eef2fb76441be Mon Sep 17 00:00:00 2001 From: scorpio Date: Tue, 10 Mar 2026 09:40:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B3=A8=E5=86=8C=20git=5Fstatus,=20gi?= =?UTF-8?q?t=5Fdiff,=20git=5Fcommit=20=E5=B7=A5=E5=85=B7=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/room/tools/definitions.go | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/internal/room/tools/definitions.go b/internal/room/tools/definitions.go index 5144a67..e1cdec9 100644 --- a/internal/room/tools/definitions.go +++ b/internal/room/tools/definitions.go @@ -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"] + }`, + }, + }, }