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

Function scanCodeCommentResponse

internal/scan/coverage_test.go:1373–1394  ·  view source on GitHub ↗
(contents ...string)

Source from the content-addressed store, hash-verified

1371}
1372
1373func scanCodeCommentResponse(contents ...string) *llm.ChatResponse {
1374 comments := make([]string, 0, len(contents))
1375 for _, content := range contents {
1376 comments = append(comments, fmt.Sprintf(`{"content":%q}`, content))
1377 }
1378 arguments := `{"comments":[` + strings.Join(comments, ",") + `]}`
1379 return &llm.ChatResponse{
1380 Choices: []llm.Choice{{
1381 Message: llm.ResponseMessage{
1382 ToolCalls: []llm.ToolCall{{
1383 ID: "comment",
1384 Type: "function",
1385 Function: llm.FunctionCall{
1386 Name: "code_comment",
1387 Arguments: arguments,
1388 },
1389 }},
1390 },
1391 }},
1392 Usage: &llm.UsageInfo{PromptTokens: 10, CompletionTokens: 5},
1393 }
1394}
1395
1396func TestDispatchSubtasks_PersistsDedupedCommentsForResume(t *testing.T) {
1397 testHome := t.TempDir()

Calls

no outgoing calls

Tested by

no test coverage detected