@@ -15,10 +15,6 @@ public static class ChatTools
1515 {
1616 "type": "object",
1717 "properties": {
18- "repo": {
19- "type": "string",
20- "description": "The path to the repository."
21- },
2218 "file": {
2319 "type": "string",
2420 "description": "The path to the file."
@@ -28,28 +24,25 @@ public static class ChatTools
2824 "description": "The path to the original file when it has been renamed or copied."
2925 }
3026 },
31- "required": ["repo", " file"]
27+ "required": ["file"]
3228 }
3329 """ ) ) , false ) ;
3430
35- public static async Task < ToolChatMessage > ProcessAsync ( ChatToolCall call , Action < string > output , string amendParent )
31+ public static async Task < ToolChatMessage > ProcessAsync ( ChatToolCall call , string repo , string amendParent , Action < string > output )
3632 {
3733 using var doc = JsonDocument . Parse ( call . FunctionArguments ) ;
3834
3935 if ( call . FunctionName . Equals ( GetDetailChangesInFile . FunctionName ) )
4036 {
41- var hasRepo = doc . RootElement . TryGetProperty ( "repo" , out var repoPath ) ;
4237 var hasFile = doc . RootElement . TryGetProperty ( "file" , out var filePath ) ;
4338 var hasOriginalFile = doc . RootElement . TryGetProperty ( "originalFile" , out var originalFilePath ) ;
44- if ( ! hasRepo )
45- throw new ArgumentException ( "repo" , "The repo argument is required" ) ;
4639 if ( ! hasFile )
4740 throw new ArgumentException ( "file" , "The file argument is required" ) ;
4841
4942 output ? . Invoke ( $ "Read changes in file: { filePath . GetString ( ) } ") ;
5043
5144 var orgFilePath = hasOriginalFile ? originalFilePath . GetString ( ) : string . Empty ;
52- var rs = await new Commands . GetFileChangeForAI ( repoPath . GetString ( ) , filePath . GetString ( ) , orgFilePath , amendParent ) . ReadAsync ( ) ;
45+ var rs = await new Commands . GetFileChangeForAI ( repo , filePath . GetString ( ) , orgFilePath , amendParent ) . ReadAsync ( ) ;
5346 var message = rs . IsSuccess ? rs . StdOut : string . Empty ;
5447 return new ToolChatMessage ( call . Id , message ) ;
5548 }
0 commit comments