Set claude 2.1 as model for slash commands
What does this MR do and why?
- The ensure that all tools have a model set
- Otherwise, they use the model default, which is Claude 3 sonnet if the user has a feature flag enabled. But these tools are still sending json request bodies for the completions API.
- See code here for default model config
- We eventually want to migrate these tools to Claude 3, but we want to support them staying on Claude 2.1 for now so we can selectively enroll users into Claude 3 without degrading behavior for existing customers.
- Resolves #454849 (closed)
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.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
- In rails console enable the experiment fully
Feature.enable(:ai_claude_3_sonnet)
- Test the slash commands:
/explain
,/refactor
, and/tests
. All should work and be using Claude 2.1
Also good to ensure that all anthropic prompts have the model
option set:
git ls-files | grep anthropic.rb
ee/lib/api/ai/experimentation/anthropic.rb
ee/lib/code_suggestions/prompts/code_generation/anthropic.rb
ee/lib/gitlab/llm/chain/agents/zero_shot/prompts/anthropic.rb
ee/lib/gitlab/llm/chain/requests/anthropic.rb
ee/lib/gitlab/llm/chain/tools/ci_editor_assistant/prompts/anthropic.rb
ee/lib/gitlab/llm/chain/tools/epic_identifier/prompts/anthropic.rb
ee/lib/gitlab/llm/chain/tools/epic_reader/prompts/anthropic.rb
ee/lib/gitlab/llm/chain/tools/explain_code/prompts/anthropic.rb
ee/lib/gitlab/llm/chain/tools/issue_identifier/prompts/anthropic.rb
ee/lib/gitlab/llm/chain/tools/issue_reader/prompts/anthropic.rb
ee/lib/gitlab/llm/chain/tools/refactor_code/prompts/anthropic.rb
ee/lib/gitlab/llm/chain/tools/summarize_comments/prompts/anthropic.rb
ee/lib/gitlab/llm/chain/tools/write_tests/prompts/anthropic.rb
We can ignore the first 2 serach results because code suggestions doesn't use the AiGateway::Client
and sets model headers here
Manual check for MODEL
being set in all other tools:
-
ee/lib/gitlab/llm/chain/agents/zero_shot/prompts/anthropic.rb
(this prompt works for claude 3 when feature flag enabled so noMODEL
needed) -
ee/lib/gitlab/llm/chain/requests/anthropic.rb
(not a tool so not applicable) -
ee/lib/gitlab/llm/chain/tools/ci_editor_assistant/prompts/anthropic.rb
-
ee/lib/gitlab/llm/chain/tools/epic_identifier/prompts/anthropic.rb
-
ee/lib/gitlab/llm/chain/tools/epic_reader/prompts/anthropic.rb
-
ee/lib/gitlab/llm/chain/tools/explain_code/prompts/anthropic.rb
-
ee/lib/gitlab/llm/chain/tools/issue_identifier/prompts/anthropic.rb
-
ee/lib/gitlab/llm/chain/tools/issue_reader/prompts/anthropic.rb
-
ee/lib/gitlab/llm/chain/tools/refactor_code/prompts/anthropic.rb
-
ee/lib/gitlab/llm/chain/tools/summarize_comments/prompts/anthropic.rb
-
ee/lib/gitlab/llm/chain/tools/write_tests/prompts/anthropic.rb
Merge request reports
Activity
changed milestone to %16.11
assigned to @jessieay
- A deleted user
added backend label
1 Message CHANGELOG missing: If this merge request needs a changelog entry, add the
Changelog
trailer to the commit message you want to add to the changelog.If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
Reviewer roulette
Category Reviewer Maintainer backend @jhyson
(UTC+12, 16 hours ahead of author)
@dskim_gitlab
(UTC+10, 14 hours ahead of author)
Please check reviewer's status!
Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Danger- Resolved by Max Fan
requested review from @lesley-r
added 209 commits
-
076f96a6...b1f401f1 - 208 commits from branch
master
- 7480a5d8 - Set claude 2.1 as model for slash commands
-
076f96a6...b1f401f1 - 208 commits from branch
- Resolved by Lesley Razzaghian
- Resolved by Max Fan
@jessieay Changes LGTM!
I also verified the original error with
/explain
on master and the fact that this MR fixes it.@mfanGitLab, can you do the backend maintainer review? Thank you!
requested review from @mfanGitLab and removed review request for @lesley-r
mentioned in issue #455112 (closed)
- Resolved by Jessie Young
Thanks @jessieay ! This MR LGTM
We're missing the
EE: true
trailer, so I'll amend the commit to add that.Pipeline's also failing due to job timeout so will trigger a new one and put MWPS
added pipeline:mr-approved label
- Resolved by Lesley Razzaghian
@mfanGitLab
, thanks for approving this merge request.This is the first time the merge request has been approved. To ensure we don't only run predictive pipelines, and we don't break
master
, a new pipeline will be started shortly.Please wait for the pipeline to start before resolving this discussion and set auto-merge for the new pipeline. See merging a merge request for more details.
enabled an automatic merge when the pipeline for f528c42d succeeds
E2E Test Result Summary
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for 7480a5d8expand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Create | 77 | 0 | 9 | 0 | 86 | ✅ | | Plan | 51 | 0 | 2 | 0 | 53 | ✅ | | Package | 24 | 0 | 6 | 0 | 30 | ✅ | | Verify | 35 | 0 | 1 | 0 | 36 | ✅ | | Govern | 66 | 0 | 0 | 0 | 66 | ✅ | | Data Stores | 31 | 0 | 0 | 0 | 31 | ✅ | | Release | 5 | 0 | 0 | 0 | 5 | ✅ | | Monitor | 7 | 0 | 0 | 0 | 7 | ✅ | | Manage | 0 | 0 | 1 | 0 | 1 | ➖ | | Analytics | 2 | 0 | 0 | 0 | 2 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 298 | 0 | 19 | 0 | 317 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+
mentioned in commit f39a6bc8
added workflowstaging-canary label and removed workflowin review label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
mentioned in issue #454849 (closed)
added workflowpost-deploy-db-production label and removed workflowproduction label
added releasedcandidate label
added releasedpublished label and removed releasedcandidate label
added pipelinetier-3 label