Skip to content

Duo Chat AI Gateway - Add context to the prompt

Enrich Duo Chat prompt with additional context information.

Implementation details

The AI gateway needs to receive the context parameter and use it to enrich the chat prompt. We can test the AI gateway change using /v2/chat/agent at http://localhost:5052/docs.

Additional context params could be similar to code suggestions.

{
  "additional_context": [
    {
      "type": "file",
      "name": "",
      "content": ""
    }
  ]
}

where:

  • type can be either file or snippet
  • name a file or a snippet name
  • content is a content itself

The prompt excerpt from code suggestions.

We should do this in two parts:

  1. Add the additional_context parameter to the aigw
  2. Make changes so the prompt in the aigw actually uses the context
Edited by Missy Davies