Skip to content

Add /v1/chat/agent endpoint

Aleksei Lipniagov requested to merge 317-chat-endpoint into main

What does this merge request do and why?

Introduces the first iteration of the /v1/chat/agent endpoint that will be used to enable Duo Chat for Self-Managed users.
Response streaming will be introduced in a separate follow-up MR.

Payload structure discussions: gitlab-org/gitlab!135837 (comment 1637068066)

alternative version of this MR - !457 (merged) - based on the discussion whether we want prompt_components as a top list in the request

Screenshots

Screenshot_2023-11-06_at_10.32.41

How to set up and validate locally

  1. Pull the branch
  2. Start the instance
  3. Open http://0.0.0.0:5052/docs#/chat/chat_v1_chat_agent_post
  4. Send the payload, example below:
{
  "type": "prompt",
  "metadata": {
    "source": "test-source",
    "version": "no-version"
  },
  "payload": {
    "content": "\n\nHuman: hello, what is your name?\n\nAssistant:",
    "provider": "anthropic",
    "model": "claude-2"
  }
}

Merge request checklist

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

Closes #317 (closed)

Edited by Aleksei Lipniagov

Merge request reports