Skip to content
Snippets Groups Projects

feat: add v2 prompt versions to support claude 3.7 sonnet

5 unresolved threads

What does this merge request do and why?

Creates a new prompt version to support the claude 3.7 model. We are making this a new major version as we can place this around a feature flag to allow for slow rollout of all Duo Chat features.

Relates: gitlab-org/gitlab#521063 (closed)

How to set up and validate locally

Request each v1/prompt/ to ensure the following tool has the updated 2.0.0 definition. The Request to LLM log should contain the claude-3-7-sonnet-20250219 parameters.

curl -X 'POST' \
   'http://gdk.test:5052/v1/prompts/<unit_primitive>' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'x-gitlab-enabled-feature-flags: expanded_ai_logging'\
    -d '{"inputs": {<required_data>}, "prompt_version": "2.0.0",  "stream": true, }'

Example logs with for documentation_search:

Log Request
suggestions:Auth is disabled, all users allowed
2025-02-24_23:39:04.03846 gitlab-ai-gateway       : INFO:snowplow_tracker.emitters:Emitter initialized with endpoint http://127.0.0.1:9091/com.snowplowanalytics.snowplow/tp2
2025-02-24_23:39:04.12846 gitlab-ai-gateway       : 2025-02-24 16:39:04 [info     ] Initializing prompt registry from local yaml correlation_id=5b4d993dedf84362bfada42dfcedc280 custom_models_enabled=False default_prompts={}
2025-02-24_23:39:04.12956 gitlab-ai-gateway       : 2025-02-24 16:39:04 [info     ] Resolved prompt id             correlation_id=5b4d993dedf84362bfada42dfcedc280 prompt_id=chat/documentation_search/base
2025-02-24_23:39:04.13347 gitlab-ai-gateway       : 2025-02-24 16:39:04 [info     ] Returning prompt from the registry correlation_id=5b4d993dedf84362bfada42dfcedc280 prompt_id=chat/documentation_search/base prompt_name='Claude 3 Documentation Search agent' prompt_version=2.0.0
2025-02-24_23:39:04.20302 gitlab-ai-gateway       : 2025-02-24 16:39:04 [info     ] Request to LLM                 api_key=None correlation_id=5b4d993dedf84362bfada42dfcedc280 request_content_json={'max_tokens': 4096, 'messages': [{'role': 'user', 'content': 'The following are provided:\n\n* <question>: question\n* <doc>: GitLab documentation, and a ATTRS which will later be converted to URL\n* <example>: example responses\n\nGiven the above:\n\nIf you know the answer, create a final answer.\n  * Then return relevant "ATTRS" part for references, under the "ATTRS:" heading.\nIf you don\'t know the answer: start the response with "Unfortunately, I could not find any documentation", and don\'t try to make up an answer.\n\n---\n\nQuestion:\n<question>How do I change my password in GitLab?</question>\n\nDocumentation:\n<doc>\nCONTENT: If you do not know your current password, select **I forgot my password**\nand complete the form. A password reset email is sent to the email address you\nenter into this form, provided that the email address is verified. If you enter an\nunverified email address into this form, no email is sent, and you see the following\nmessage:\n\n> "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."\n\nNOTE:\nYour account can have more than one verified email address, and any email address\nassociated with your account can be verified.\n\n## Password requirements\n\nYour passwords must meet a set of requirements when:\n\n- You choose a password during registration.\n- You choose a new password using the forgotten password reset flow.\n- You change your password proactively.\n- You change your password after it expires.\n- An administrator creates your account.\n- An administrator updates your account.\n\nBy default GitLab enforces the following password requirements:\n\n- Minimum and maximum password lengths. For example,\n  see [the settings for GitLab.com](../gitlab_com/index.md#password-requirements).\n- Disallowing [weak passwords](#block-weak-passwords).\n\nSelf-managed installations can configure the following additional password requirements:\n\n- [Password minimum and maximum length limits](../../security/password_length_limits.md).ATTRS: CNT-IDX-fe781284e5cecb386896118bb573adb5\n</doc>\n<doc>\nCONTENT: # Reset a user\'s password\n\nDETAILS:\n**Tier:** Free, Premium, Ultimate\n**Offering:** Self-managed, GitLab Dedicated\n\nYou can reset user passwords by using the UI, a Rake task, a Rails console, or the\n[Users API](../api/users.md#user-modification).\n\n## Prerequisites\n\nTo reset a user password, you must be an administrator of a self-managed GitLab instance.\n\nThe user\'s new password must meet all [password requirements](../user/profile/user_passwords.md#password-requirements).\n\n## Use the UI\n\nTo reset a user\'s password in the UI:\n\n1. On the left sidebar, at the bottom, select **Admin Area**.\n1. Select **Overview > Users**.\n1. For the user whose password you want to update, select **Edit**.\n1. In the **Password** area, type a password and password confirmation.\n1. Select **Save changes**.\n\nA confirmation is displayed.\n\n## Use a Rake task\n\nUse the following Rake task to reset a user\'s password.\n\n::Tabs\n\n:::TabTitle Linux package (Omnibus)\n\n```shell\nsudo gitlab-rake "gitlab:password:reset"\n```\n\n:::TabTitle Self-compiled (source)\n\n```shell\nbundle exec rake "gitlab:password:reset"\n```\n\n::EndTabs\n\nGitLab requests a username, a password, and confirmation of the password. When complete, the user\'s password is updated.\n\nThe Rake task can take a username as an argument. For example, to reset the password for the user with username\n`sidneyjones`:\n\n::Tabs\n\n:::TabTitle Linux package (Omnibus)\n\n  ```shell\n  sudo gitlab-rake "gitlab:password:reset[sidneyjones]"\n  ```\nATTRS: CNT-IDX-9effe73ba22edf411e160f64a0416e80\n</doc>\n<doc>\nCONTENT: # User passwords\n\nDETAILS:\n**Tier:** Free, Premium, Ultimate\n**Offering:** GitLab.com, Self-managed, GitLab Dedicated\n\nIf you use a password to sign in to GitLab, a strong password is very important. A weak or guessable password makes it\neasier for unauthorized people to sign in to your account.\n\nSome organizations require you to meet certain requirements when choosing a password.\n\nImprove the security of your account with [two-factor authentication](account/two_factor_authentication.md)\n\n## Choose your password\n\nYou can choose a password when you [create a user account](account/create_accounts.md).\n\nIf you register your account using an external authentication and\nauthorization provider, you do not need to choose a password. GitLab\n[sets a random, unique, and secure password for you](../../security/passwords_for_integrated_authentication_methods.md).\n\n## Change your password\n\n> - Password reset emails sent to any verified email address [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/16311) in GitLab 16.1.\n\nYou can change your password. GitLab enforces [password requirements](#password-requirements) when you choose your new\npassword.\n\n1. On the left sidebar, select your avatar.\n1. Select **Edit profile**.\n1. On the left sidebar, select **Password**.\n1. In the **Current password** text box, enter your current password.\n1. In the **New password** and **Password confirmation** text box, enter your new password.\n1. Select **Save password**.ATTRS: CNT-IDX-c850f74fc44686f57b644f021f6f55b5\n</doc>\n<doc>\nCONTENT: Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.\n\nTo reset the Jira user\'s password for all projects with active Jira integrations,\nrun the following in a [Rails console](../../administration/operations/rails_console.md#starting-a-rails-console-session):\n\n```ruby\np = Project.find_by_sql("SELECT p.id FROM projects p LEFT JOIN integrations i ON p.id = i.project_id WHERE i.type_new = \'Integrations::Jira\' AND i.active = true")\n\np.each do |project|\n  project.jira_integration.update_attribute(:password, \'<your-new-password>\')\nend\n```\n\n## Jira issue list\n\nWhen [viewing Jira issues](configure.md#view-jira-issues) in GitLab, you might encounter the following issues.\n\n### `500 We\'re sorry` when accessing a Jira issue in GitLab\n\nWhen accessing a Jira issue in GitLab, you might get a `500 We\'re sorry. Something went wrong on our end` error.\nCheck [`production.log`](../../administration/logs/index.md#productionlog) to see if the file contains the following exception:\n\n```plaintext\n:NoMethodError (undefined method \'duedate\' for #<JIRA::Resource::Issue:0x00007f406d7b3180>)\n```\n\nIf that\'s the case, ensure the [**Due date** field is visible for issues](https://confluence.atlassian.com/jirakb/due-date-field-is-missing-189431917.html) in the integrated Jira project.\n\n### Error when requesting data from JiraATTRS: CNT-IDX-361688f033616b72df13d6b3b47552e4\n</doc>\n\nExample responses:\n<example>\n  The documentation for configuring AIUL is present. The relevant sections provide step-by-step instructions on how to configure it in GitLab, including the necessary settings and fields. The documentation covers different installation methods, such as A, B and C.\n\n  ATTRS:\n  CNT-IDX-a52b551c78c6cc11a603e231b4e789b2\n  CNT-IDX-27d7595271143710461371bcef69ed1e\n</example>\n<example>\n  Unfortunately, I could not find any documentation related to this question.\n\n  ATTRS:\n</example>\n<example>\n  Unfortunately, I could not find any documentation about the REFS configuration.\n  One documentation mentions that the restriction can be changed by an owner, but it does not specify how to do it.\n\n  ATTRS:\n  CNT-IDX-a52b551c78c6cc11a603e231b4e789b2\n</example>'}, {'role': 'assistant', 'content': 'FINAL ANSWER:'}], 'model': 'claude-3-7-sonnet-20250219', 'stream': True, 'temperature': 0.1} request_method=POST request_url=URL('https://api.anthropic.com/v1/messages') source=ai_gateway.models.base
2025-02-24_23:39:08.35808 gitlab-ai-gateway       : 2025-02-24 16:39:08 [info     ] Request to LLM complete        correlation_id=5b4d993dedf84362bfada42dfcedc280 duration=4.211037499999293 source=ai_gateway.instrumentators.model_requests
2025-02-24_23:39:08.35865 gitlab-ai-gateway       : 2025-02-24 16:39:08 [info     ] 172.16.123.1:57684 - "POST /v1/prompts/chat/documentation_search HTTP/1.1" 200 client_ip=172.16.123.1 client_port=57684 content_type='text/event-stream; charset=utf-8' correlation_id=5b4d993dedf84362bfada42dfcedc280 cpu_s=0.1964920000000001 duration_request=-1 duration_s=4.320605584000077 enabled_feature_flags=expanded_ai_logging first_chunk_duration_s=1.220505334000336 gitlab_duo_seat_count=None gitlab_feature_enabled_by_namespace_ids=None gitlab_feature_enablement_type=None gitlab_global_user_id=None gitlab_host_name=None gitlab_instance_id=None gitlab_language_server_version=None gitlab_realm=None gitlab_saas_duo_pro_namespace_ids=None gitlab_version=None http_version=1.1 meta.feature_category=ai_abstraction_layer method=POST path=/v1/prompts/chat/documentation_search request_arrived_at=2025-02-24T23:39:04.037905+00:00 response_start_duration_s=0.10896483400028956 status_code=200 tracked_internal_events=['request_documentation_search'] url=http://gdk.test:5052/v1/prompts/chat/documentation_search user_agent=curl/8.7.1

Merge request checklist

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

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 ---
2 name: Claude 3 Build Reader agent
  • 1 ---
    2 name: Claude 3 Commit Reader agent
    3 model:
    4 config_file: claude_3_7
    5 params:
    6 max_tokens: 2_048
    7 unit_primitives:
    8 - ask_commit
  • 1 ---
    2 name: Claude 3 Documentation Search agent
    3 model:
    4 config_file: claude_3_7
    5 params:
    6 temperature: 0.1
  • Jessie Young left review comments without approving or requesting changes

    left review comments without approving or requesting changes

  • added 1 commit

    • d332776d - fix: remove poor quality prompts

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • d9fcd9c3 - feat: replace chat model version

    Compare with previous version

  • added 1 commit

    • c0caa25d - chore: add new model configuration file

    Compare with previous version

  • Nathan Weinshenker changed title from chore: add new model configuration file to feat: add v2 prompt versions to support claude 3.7 sonnet

    changed title from chore: add new model configuration file to feat: add v2 prompt versions to support claude 3.7 sonnet

  • Jessie Young removed review request for @jessieay

    removed review request for @jessieay

  • Jessie Young mentioned in merge request !2033 (merged)

    mentioned in merge request !2033 (merged)

  • FYI @juan-silva and team on this MR

  • added groupduo chat label and removed groupai framework label

  • closed

  • Shinya Maeda mentioned in issue #810

    mentioned in issue #810

  • Please register or sign in to reply
    Loading