Skip to content

docs: update fastapi /v1/chat/endpoint base model

What does this merge request do and why?

A chore to align our Gitlab AI Feature docs with the following example in AI Gateway's FastAPI docs.

We reference we are using Claude 3 for Duo Chat in most of our docs, so the following MR reflects that reality in the AI Gateway API v1/chat/agent endpoint.

How to set up and validate locally

Before After
Screenshot_2024-07-12_at_3.03.07_PM Screenshot_2024-07-12_at_3.02.47_PM
  1. Open the ai-gateway docs at http://localhost:5052/docs#/chat/chat_v1_chat_agent_post
  2. Run the following example requeset
curl --request POST \
  --url 'http://localhost:5052/v1/chat/agent' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'X-Gitlab-Authentication-Type: oidc' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "prompt_components": [
    {
      "type":"prompt",
      "payload": {
        "content": [
          {
            "role": "user", 
            "content": "Hi, how are you?"
          }
        ],
        "provider": "anthropic",
        "model": "claude-3-sonnet-20240229"
      },
      "metadata": {
        "source": "GitLab EE",
        "version": "16.7.0"
      }
    }
 ]
}'
  1. Make the response is a valid 200

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