Skip to content

Enabled CI editor Assistant to use Claude 3 behind feature flag

Nathan Weinshenker requested to merge jy-example-tool into master

What does this MR do and why?

The following MR moves the CIEditorAssistant to match the Claude 3 API prompt messaging API. More specifically, we are trying to match the AI gateway's API to show the following prompt format:

[
  {"role": "user", "content": "Hello there."},
  {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
  {"role": "user", "content": "Can you explain LLMs in plain English?"},
]

Why:

We are migrating Duo features towards relying on Claude 3. This is a large push by the org to accomplish this work.

The following feature no longer exists for testing

[5] pry(main)> Feature.enabled?(:ai_claude_3_sonnet)
Feature::InvalidFeatureFlagError: Missing type for undefined feature `ai_claude_3_sonnet`

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

  • Tested the new feature locally to see if it handles correctly the prompt messaging with the claude-3 model.
  • Test to make sure we don't have regression issues with the existing models.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After Prompt Format
Feature.enabled?(:ai_claude_3_ci_editor)=> true Screenshot_2024-04-17_at_10.21.07_AM Screenshot_2024-04-17_at_10.54.27_AM
Feature.enabled?(:ai_claude_3_ci_editor) => false Screenshot_2024-04-17_at_10.28.48_AM Screenshot_2024-04-17_at_10.50.52_AM

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. In rails console enable the experiment fully

    Feature.enable(:ai_claude_3_ci_editor)
  2. Go to the following project where AI features have been enabled. Run any following prompt related to the ".gitlab-ci.yml" file.

  3. Verify message created is in line with expectations. Here's an example LangSmith trace for the following run of Duo.

Edited by Nathan Weinshenker

Merge request reports

Loading