Skip to content

feat: add summarize merge request prompt for Claude 3.7 Sonnet

What does this merge request do and why?

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

Screenshot_2025-02-26_at_6.11.24_PM

Screenshot_2025-02-26_at_6.11.38_PM

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

Merge request reports

Loading