Skip to content

Draft: feat: implement generate_description endpoint

Alejandro Rodríguez requested to merge generate-description into main

What does this merge request do and why?

Add a new endpoint to generate issue descriptions, to allow us to move this feature from the monolith to the AIGW.

This MR is also meant to demonstrate how moving features will work using the prompt registry. See gitlab-org/gitlab#432594 (closed) for more details

How to set up and validate locally

  • Execute a request without a template:
curl -X 'POST' \
  'http://0.0.0.0:5052/v1/generate_description' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "content": "The system charges you twice if you have two items in your cart",
  "template": null
}'
  • Execute a request with a template:
curl -X 'POST' \
  'http://0.0.0.0:5052/v1/generate_description' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "content": "The system charges you twice if you have two items in your cart. The log includes the error '\''connection error'\''",
  "template":"<!---\nPlease read this!\n\nBefore opening a new issue, make sure to search for keywords in the issues\nfiltered by the \"regression\" or \"type::bug\" label:\n\n- https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression\n- https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=type::bug\n\nand verify the issue you'\''re about to submit isn'\''t a duplicate.\n--->\n\n### Summary\n\n<!-- Summarize the bug encountered concisely. -->\n\n### Steps to reproduce\n\n<!-- Describe how one can reproduce the issue - this is very important. Please use an ordered list. -->\n\n### Example Project\n\n<!-- If possible, please create an example project here on GitLab.com that exhibits the problematic \nbehavior, and link to it here in the bug report. If you are using an older version of GitLab, this \nwill also determine whether the bug is fixed in a more recent version. -->\n\n### What is the current *bug* behavior?\n\n<!-- Describe what actually happens. -->\n\n### What is the expected *correct* behavior?\n\n<!-- Describe what you should see instead. -->\n\n### Relevant logs and/or screenshots\n\n<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code\n as it'\''s tough to read otherwise. -->\n\n### Output of checks\n\n<!-- If you are reporting a bug on GitLab.com, uncomment below -->\n\n<!-- This bug happens on GitLab.com -->\n<!-- /label ~\"reproduced on GitLab.com\" -->\n\n#### Results of GitLab environment info\n\n<!--  Input any relevant GitLab environment information if needed. -->\n\n<details>\n<summary>Expand for output related to GitLab environment info</summary>\n\n<pre>\n\n(For installations with omnibus-gitlab package run and paste the output of:\n`sudo gitlab-rake gitlab:env:info`)\n\n(For installations from source run and paste the output of:\n`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)\n\n</pre>\n</details>\n\n#### Results of GitLab application Check\n\n<!--  Input any relevant GitLab application check information if needed. -->\n\n<details>\n<summary>Expand for output related to the GitLab application check</summary>\n<pre>\n\n(For installations with omnibus-gitlab package run and paste the output of:\n`sudo gitlab-rake gitlab:check SANITIZE=true`)\n\n(For installations from source run and paste the output of:\n`sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true`)\n\n(we will only investigate if the tests are passing)\n\n</pre>\n</details>\n\n### Possible fixes\n\n<!-- If you can, link to the line of code that might be responsible for the problem. -->\n\n/label ~\"type::bug\"\n"
}'

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.
Edited by Alejandro Rodríguez

Merge request reports