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

Function codeCommentResponse

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected