Skip to content

Switch to Claude for issue description generation

euko requested to merge 417248-switch-to-anthropic into master

What does this MR do and why?

Related to #417248

You can have LLMs rewrite and generate issue descriptions based off a text. For example, you may type "I discovered a XSS vulnerability" to generate a fuller description:

Description generation demo

Screen_Recording_2023-11-02_at_13.05.00

The described feature is already in production and uses OpenAI's completion API.

This MR ports the feature to use Anthropic's Claude which supports a higher number of tokens.

The ported version will be gated with a new feature flag and after the rollout the existing version will be removed. claude_description_generation is the name of the new feature flag.

Existing version Ported version created in this MR
ee/lib/gitlab/llm/open_ai/completions/generate_description.rb ee/lib/gitlab/llm/anthropic/completions/generate_description.rb
ee/lib/gitlab/llm/open_ai/templates/generate_description.rb ee/lib/gitlab/llm/templates/generate_description.rb
ee/lib/gitlab/llm/anthropic/response_modifiers/generate_description.rb

How to set up and validate locally

You need to setup your GDK to run AI features first.

Enable the new feature flag in the console:

Feature.enable(:claude_description_generation)

Create a new issue and use the tanuki icon in the text editor's toolbar to access the feature:

Screen_Recording_2023-11-02_at_13.37.41

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by euko

Merge request reports