feat: add summarize merge request prompt for Claude 3.7 Sonnet
What does this merge request do and why?
- This MR adds a new prompt for summarize merge request for Claude 3.7 Sonnet
- Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/521399, https://gitlab.com/gitlab-org/gitlab/-/issues/478035
How to set up and validate locally
- Make the curl request to use the new prompt version:
curl -X 'POST' \
'http://localhost:5052/v1/prompts/summarize_new_merge_request' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"inputs": {"extracted_diff": "diff --git a/main.go b/main.go\nindex abc1234..def5678 100644\n--- a/main.go\n+++ b/main.go\n@@ -10,6 +10,14 @@ func main() {\n \tfmt.Println(\"Hello World\")\n }\n \n+func parseEnvFile(filename string) (map[string]string, error) {\n+\tresult := make(map[string]string)\n+\tdata, err := os.ReadFile(filename)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\t// Parse file content and populate result map\n+\treturn result, nil\n+}\n+\n func logError(err error) {\n \tif err != nil {\n \t\tlog.Fatal(err)\n"},
"prompt_version": "2.0.0",
"stream": false
}'
- Fetch the logs to make sure it's using the new prompt version:
gdk tail -f gitlab-ai-gateway | grep "Request to LLM"
Screenshots
Merge request checklist
-
Tests added for new functionality. If not, please raise an issue to follow up. -
Documentation added/updated, if needed.
Credits to @nateweinshenker for helping me with the testing steps
Edited by Kinshuk Singh

