Enabled CI editor Assistant to use Claude 3 behind feature flag
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 |
||
Feature.enabled?(:ai_claude_3_ci_editor) => false |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
In rails console enable the experiment fully
Feature.enable(:ai_claude_3_ci_editor)
-
Go to the following project where AI features have been enabled. Run any following prompt related to the ".gitlab-ci.yml" file.
-
Verify message created is in line with expectations. Here's an example LangSmith trace for the following run of Duo.