(path string)
| 87 | } |
| 88 | |
| 89 | func codeCommentResponse(path string) *llm.ChatResponse { |
| 90 | content := "" |
| 91 | args := map[string]any{ |
| 92 | "comments": []any{ |
| 93 | map[string]any{ |
| 94 | "content": "potential null pointer", |
| 95 | "existing_code": "foo := bar.Baz()", |
| 96 | "path": path, |
| 97 | }, |
| 98 | }, |
| 99 | } |
| 100 | argsJSON, _ := json.Marshal(args) |
| 101 | return &llm.ChatResponse{ |
| 102 | Choices: []llm.Choice{{ |
| 103 | Message: llm.ResponseMessage{ |
| 104 | Content: &content, |
| 105 | ToolCalls: []llm.ToolCall{{ |
| 106 | ID: "call_comment", |
| 107 | Type: "function", |
| 108 | Function: llm.FunctionCall{ |
| 109 | Name: "code_comment", |
| 110 | Arguments: string(argsJSON), |
| 111 | }, |
| 112 | }}, |
| 113 | }, |
| 114 | }}, |
| 115 | Model: "fake", |
| 116 | Usage: &llm.UsageInfo{PromptTokens: 50, CompletionTokens: 20}, |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | // TestBuildGroupFilterCommentsJSON covers the group-level serialization: the |
| 121 | // filter sees one flat, globally indexed list spanning every file in the group, |
no outgoing calls
no test coverage detected