Skip to content

Switch Tanuki bot to Anthropic

Jan Provaznik requested to merge jp-doc-ant-small into master

What does this MR do and why?

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/417146

For embeddings OpenAI is still used but fetched documents are now passed to Anthropic instead of OpenAI (https://gitlab.com/gitlab-org/gitlab/-/issues/417146#note_1463408695)

This is the minimal approach of switching to Anthropic. Similarly to !125217 (merged) in a next step we should consider to use consistent approach and perhaps migrate business logic into chain's tool. Because this will require larger refactoring, let's start with switching just provider for now.

Screenshots or screen recordings

A diff of output of running rake gitlab:llm:zero_shot:test:questions[http://192.168.1.8:3000/flightjs/Flight/-/issues/1] on doc-related questions:

< INFO -- : actual response: {"content":"To change your password in GitLab, follow these steps:\n1. On the left sidebar, select your avatar.\n2. Select **Edit profile**.\n3. On the left sidebar, select **Password**.\n4. In the **Current password** text box, enter your current password.\n5. In the **New password** and **Password confirmation** text box, enter your new password.\n6. Select **Save password**.\n7. If you do not know your current password, select **I forgot my password**","sources":[{"source_url":"http://127.0.0.1:3000/help/subscriptions/customers_portal","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Purchase","stage":"Fulfillment","title":"The Customers Portal","source":"/doc/subscriptions/customers_portal.md","source_type":"doc"},{"source_url":"http://192.168.1.8:3000/help/subscriptions/customers_portal","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Purchase","stage":"Fulfillment","title":"The Customers Portal","source":"/doc/subscriptions/customers_portal.md","source_type":"doc"},{"source_url":"http://192.168.1.8:3000/help/user/profile/index","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","type":"index, howto","group":"Authentication and Authorization","stage":"Manage","title":"User account","source":"/doc/user/profile/index.md","source_type":"doc"}]}
---
> INFO -- : actual response: {"content":"Here are the steps to change your password in GitLab:\n\n1. On the left sidebar, select your avatar.\n2. Select **Edit profile**. \n3. On the left sidebar, select **Password**.\n4. In the **Current password** text box, enter your current password.\n5. In the **New password** and **Password confirmation** text box, enter your new password.\n6. Select **Save password**.","sources":[{"source_url":"http://127.0.0.1:3000/help/subscriptions/customers_portal","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Purchase","stage":"Fulfillment","title":"The Customers Portal","source":"/doc/subscriptions/customers_portal.md","source_type":"doc"},{"source_url":"http://192.168.1.8:3000/help/subscriptions/customers_portal","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Purchase","stage":"Fulfillment","title":"The Customers Portal","source":"/doc/subscriptions/customers_portal.md","source_type":"doc"},{"source_url":"http://192.168.1.8:3000/help/user/profile/index","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","type":"index, howto","group":"Authentication and Authorization","stage":"Manage","title":"User account","source":"/doc/user/profile/index.md","source_type":"doc"},{"source_url":"http://192.168.1.8:3000/help/user/profile/user_passwords","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Authentication and Authorization","stage":"Manage","title":"User passwords","source":"/doc/user/profile/user_passwords.md","source_type":"doc"}]}
13c13
< INFO -- : actual response: {"content":"To fork a project in GitLab, select **Fork** in the upper right corner on the project's homepage. This will create a new project based off the existing project and redirect you to the new fork's page. Optional steps include editing the Project name, Project URL (which should belong to a namespace), Project slug (unique in the namespace), and Project description. Lastly, select the Visibility level for your fork.","sources":[{"source_url":"http://192.168.1.8:3000/help/user/project/repository/forking_workflow","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Source Code","stage":"Create","title":"Project forking workflow","source":"/doc/user/project/repository/forking_workflow.md","source_type":"doc"}]}
---
> INFO -- : actual response: {"content":"To fork a project:\n\n1. On the project's homepage, in the upper-right corner, select **Fork** (**{fork}**):\n   ![Fork this project](img/forking_workflow_fork_button_v13_10.png)\n1. Optional. Edit the **Project name**.\n1. For **Project URL**, select the [namespace](../../namespace/index.md)\n   your fork should belong to.\n1. Add a **Project slug**. This value becomes part of the URL to your fork.\n   It must be unique in the namespace.\n1. Optional. Add a **Project description**.\n1. Select the **Visibility level** for your fork. For more information about","sources":[{"source_url":"http://127.0.0.1:3000/help/tutorials/make_first_git_commit/index","info":"For assistance with this tutorial, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments-to-other-projects-and-subjects.","group":"Tutorials","stage":"none","title":"Tutorial: Make your first Git commit","source":"/doc/tutorials/make_first_git_commit/index.md","source_type":"doc"},{"source_url":"http://127.0.0.1:3000/help/user/project/merge_requests/creating_merge_requests","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Code Review","stage":"Create","title":"Creating merge requests","source":"/doc/user/project/merge_requests/creating_merge_requests.md","description":"How to create merge requests in GitLab.","source_type":"doc"},{"source_url":"http://127.0.0.1:3000/help/user/project/repository/forking_workflow","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Source Code","stage":"Create","title":"Project forking workflow","source":"/doc/user/project/repository/forking_workflow.md","source_type":"doc"},{"source_url":"http://192.168.1.8:3000/help/user/project/repository/forking_workflow","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Source Code","stage":"Create","title":"Project forking workflow","source":"/doc/user/project/repository/forking_workflow.md","source_type":"doc"}]}
22c22
< INFO -- : actual response: {"content":"To clone a repository, go to the project's overview page, select Clone and copy the URL for Clone with SSH. Then open a terminal on your computer, go to the directory where you want to clone the files and enter `git clone` and paste the URL.","sources":[{"source_url":"http://192.168.1.8:3000/help/user/project/repository/index","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Source Code","stage":"Create","title":"Repository","source":"/doc/user/project/repository/index.md","source_type":"doc"}]}
---
> INFO -- : actual response: {"content":"To clone a repository:\n\n1. Go to the project's overview page.\n2. Select **Clone**. \n3. Copy the URL for **Clone with SSH** or **Clone with HTTPS**.\n4. Open a terminal and go to the directory where you want to clone the files.\n5. Enter `git clone` and paste the URL.\n6. Go to the directory.","sources":[{"source_url":"http://127.0.0.1:3000/help/topics/git/terminology","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Source Code","stage":"Create","title":"Git concepts","source":"/doc/topics/git/terminology.md","source_type":"doc"},{"source_url":"http://127.0.0.1:3000/help/tutorials/make_first_git_commit/index","info":"For assistance with this tutorial, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments-to-other-projects-and-subjects.","group":"Tutorials","stage":"none","title":"Tutorial: Make your first Git commit","source":"/doc/tutorials/make_first_git_commit/index.md","source_type":"doc"},{"source_url":"http://192.168.1.8:3000/help/topics/git/terminology","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Source Code","stage":"Create","title":"Git concepts","source":"/doc/topics/git/terminology.md","source_type":"doc"},{"source_url":"http://192.168.1.8:3000/help/tutorials/make_first_git_commit/index","info":"For assistance with this tutorial, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments-to-other-projects-and-subjects.","group":"Tutorials","stage":"none","title":"Tutorial: Make your first Git commit","source":"/doc/tutorials/make_first_git_commit/index.md","source_type":"doc"},{"source_url":"http://192.168.1.8:3000/help/user/project/repository/index","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Source Code","stage":"Create","title":"Repository","source":"/doc/user/project/repository/index.md","source_type":"doc"}]}
31c31
< INFO -- : actual response: {"content":"To create a project from a built-in template, go to the left sidebar and select Create new \u003e New project/repository. Then select Create from template, select the Built-in tab, and select the template you want to use. Then enter the project details, including the project name (lowercase or uppercase letters, digits, emojis, or underscores) and the path to your project.","sources":[{"source_url":"http://192.168.1.8:3000/help/user/project/index","info":"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments","group":"Tenant Scale","stage":"Data Stores","title":"Create a project","source":"/doc/user/project/index.md","source_type":"doc"}]}
---
> INFO -- : actual response: {"content":"I apologize, but based on the given text I do not know how to create a project template. The passages describe how to create blank projects, projects from built-in templates, and merge request templates, but do not mention creating project templates.","sources":[]}

Based on above I think docuemntation questions are still replied well, for the last question it's actually not answered, but it gives a reasonable reason why it's not answered.

How to set up and validate locally

https://docs.gitlab.com/ee/development/ai_features.html#testing-gitlab-duo-chat-with-predefined-questions

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 Jan Provaznik

Merge request reports