MCPcopy Create free account
hub / github.com/alibaba/open-code-review / codeCommentResponse

Function codeCommentResponse

internal/agent/agent_test.go:89–118  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

87}
88
89func 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,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected