Skip to content

fix: adds private provider support for v1/chat/

Eduardo Bonet requested to merge identifier-for-agent-v1 into main

What does this merge request do and why?

fix: adds private provider support for v1/chat/

Support for third party model providers was added to v2/chat/agent, but not to v1.

How to set up and validate locally

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

Run the following curl command (set the anthropic key)

curl -X 'POST' \
  'http://localhost:5052/v1/chat/agent' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "prompt_components": [
      {
        "type": "prompt",
        "metadata": {
          "source": "GitLab EE",
          "version": "17.5.0"
        },
        "payload": {
          "content": [
            {
              "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 create an issue?</question>\n\nDocumentation:\n<doc>\nCONTENT: DETAILS:\n**Tier:** Premium, Ultimate\n**Offering:** GitLab.com, Self-managed, GitLab Dedicated  \n<!-- vale gitlab.FutureTense = NO -->  \nThis tutorial shows you how to set up [issue boards](../../user/project/issue_board.md) and [scoped labels](../../user/project/labels.md#scoped-labels) for two teams that work on issues in sequence.  \nIn this example, you'\''ll create two issue boards for the UX and Frontend teams.\nUsing the following steps, you can create issue boards and workflows for more sub-teams, like Backend\nor Quality Assurance.\nTo learn how we use workflow labels at GitLab, see [Product Development Flow](https://handbook.gitlab.com/handbook/product-development-flow/).  \nTo set up issue boards for multiple teams:  \n1. [Create a group](#create-a-group)\n1. [Create a project](#create-a-project)\n1. [Create labels](#create-labels)\n1. [Create team issue boards](#create-team-issue-boards)\n1. [Create issues for features](#create-issues-for-features)\nATTRS: CNT-IDX-/var/folders/24/dn3kffts6bq0mh817420bb3r0000gn/T/tmpa_u0mri2/gitlab-v17.0.0-ee-doc/doc/tutorials/boards_for_teams/index.md\n</doc>\n\n<doc>\nCONTENT: When you create a new issue, a checkbox right below the text area is available\nto mark the issue as confidential. Check that box and select **Create issue**\nto create the issue.  \nWhen you create a confidential issue in a project, the project becomes listed in the **Contributed projects** section in your [profile](../../profile/index.md). **Contributed projects** does not show information about the confidential issue; it only shows the project name.  \nTo create a confidential issue:  \n1. On the left sidebar, select **Search or go to** and find your project.\n1. On the left sidebar, at the top, select **Create new** (**{plus}**).\n1. From the dropdown list, select **New issue**.\n1. Complete the [fields](create_issues.md#fields-in-the-new-issue-form).\n- Select the **This issue is confidential** checkbox.\n1. Select **Create issue**.\nATTRS: CNT-IDX-/var/folders/24/dn3kffts6bq0mh817420bb3r0000gn/T/tmpa_u0mri2/gitlab-v17.0.0-ee-doc/doc/user/project/issues/confidential_issues.md\n</doc>\n\n<doc>\nCONTENT: DETAILS:\n**Tier:** Free, Premium, Ultimate\n**Offering:** GitLab.com, Self-managed, GitLab Dedicated  \n<!-- vale gitlab.FutureTense = NO -->  \nIssue triage is the process of categorization according to type and severity.\nAs your project grows and people create more issues, it'\''s worth creating a workflow for how you'\''ll\ntriage incoming issues.  \nIn this tutorial, you'\''ll learn how to set up a GitLab project for this.  \nTo set up GitLab for issue triage in a project:  \n1. [Create a project](#create-a-project)\n1. [Decide on the criteria for types, severity, and priority](#decide-on-the-criteria-for-types-severity-and-priority)\n1. [Document your criteria](#document-your-criteria)\n1. [Create scoped labels](#create-scoped-labels)\n1. [Prioritize the new labels](#prioritize-the-new-labels)\n1. [Create an issue triage board](#create-an-issue-triage-board)\n1. [Create issues for features](#create-issues-for-features)\nATTRS: CNT-IDX-/var/folders/24/dn3kffts6bq0mh817420bb3r0000gn/T/tmpa_u0mri2/gitlab-v17.0.0-ee-doc/doc/tutorials/issue_triage/index.md\n</doc>\n\n<doc>\nCONTENT: Like with labels, you could create your issue boards in the **Paperclip Assistant** project,\nbut it can be better to have them in the **Paperclip Software Factory** group. This way, you'\''ll be able\nto manage issues from all the projects that you might create later in this group.  \nTo create a new group issue board:  \n1. On the left sidebar, select **Search or go to** and find your **Paperclip Software Factory** group.\n1. Select **Plan > Issue boards**.\n1. Create the UX workflow and Frontend workflow boards.  \nTo create the **UX workflow** issue board:  \n1. In the upper-left corner of the issue board page, select the dropdown list with the current board name.\n1. Select **Create new board**.\n1. In the **Title field**, enter `UX workflow`.\n1. Clear the **Show the Open list** and **Show the Closed list** checkboxes.\n1. Select **Create board**. You should see an empty board.\n1. Create a list for the `Workflow::Ready for design` label:\n1. In the upper-right corner of the issue board page, select **Create list**.\n1. In the column that appears, from the **Value** dropdown list, select the `Workflow::Ready for design` label.\n1. Select **Add to board**.\n1. Repeat the previous step for labels `Workflow::Design` and `Workflow::Ready for development`.  \n![Issue board called \"UX workflow\" with three columns and no issues](img/ux_board_empty_v16_0.png)  \nTo create the **Frontend workflow** board:  \n1. In the upper-left corner of the issue board page, select the dropdown list with the current board name.\n1. Select **Create new board**.\n1. In the **Title field**, enter `Frontend workflow`.\n1. Clear the **Show the Open list** and **Show the Closed list** checkboxes.\n1. Expand **Scope**.\n1. Next to **Labels**, select **Edit** and select the `Frontend` label.\n1. Select **Create board**.\n1. Create a list for the `Workflow::Ready for development` label:\n1. In the upper-right corner of the issue board page, select **Create list**.\n1. In the column that appeared, from the **Value** dropdown list, select the `Workflow::Ready for development` label.\n1. Select **Add to board**.\n1. Repeat the previous step for labels `Workflow::In development` and `Workflow::Complete`.  \n![Issue board called \"Frontend workflow\" with three columns and no issues](img/frontend_board_empty_v16_0.png)  \nFor now, lists in both your boards should be empty. Next, you'\''ll populate them with some issues.\nATTRS: CNT-IDX-/var/folders/24/dn3kffts6bq0mh817420bb3r0000gn/T/tmpa_u0mri2/gitlab-v17.0.0-ee-doc/doc/tutorials/boards_for_teams/index.md\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>\n"
            },
            {
              "role": "assistant",
              "content": "FINAL ANSWER:"
            }
          ],
          "params": {
            "temperature": 0.1,
            "max_tokens_to_sample": 4096,
            "stop_sequences": [
              "\n\nHuman",
              "Observation:"
            ]
          },
          "provider": "litellm",
          "model": "claude_3",
          "model_endpoint": "https://api.anthropic.com/",
          "model_api_key": "$ANTHROPIC_API_KEY",
          "model_identifier": "anthropic/claude-3-5-sonnet-20240620"
        }
      }
    ],
    "stream": true
  }'

Merge request checklist

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

Merge request reports

Loading