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

Function codeCommentResponse

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

Source from the content-addressed store, hash-verified

54}
55
56func codeCommentResponse(path string) *llm.ChatResponse {
57 content := ""
58 args := map[string]any{
59 "path": path,
60 "comments": []any{
61 map[string]any{
62 "content": "potential null pointer",
63 "existing_code": "foo := bar.Baz()",
64 },
65 },
66 }
67 argsJSON, _ := json.Marshal(args)
68 return &llm.ChatResponse{
69 Choices: []llm.Choice{{
70 Message: llm.ResponseMessage{
71 Content: &content,
72 ToolCalls: []llm.ToolCall{{
73 ID: "call_comment",
74 Type: "function",
75 Function: llm.FunctionCall{
76 Name: "code_comment",
77 Arguments: string(argsJSON),
78 },
79 }},
80 },
81 }},
82 Model: "fake",
83 Usage: &llm.UsageInfo{PromptTokens: 50, CompletionTokens: 20},
84 }
85}
86
87func TestBuildFilterCommentsJSON(t *testing.T) {
88 tests := []struct {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected