Skip to content

Store additional context as part of extras

What does this MR do and why?

Store and retrieve Duo Chat additional context as part of extras param.

That's not a breaking change, since all the additional context feature is WIP and guarded by a feature flag

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshot_2024-09-16_at_15.50.02

How to set up and validate locally

  1. Open http://gdk.test:3000/-/graphql-explorer
  2. Create a message
    mutation chatAction {
      aiAction(input: {chat: {content: "Explain this code", additionalContext: [
        {
          category: SNIPPET, id: "hello world", content: "puts 'Hello, world'",
          metadata: "{ \"freeform\": \"json\", \"e\": 1 }"
        }
      ]}}) {
        clientMutationId
        errors
        requestId
      }
    }
  3. Read messages
    query getMessages {
      aiMessages {
        edges {
          node {
            id
            content
            extras {
              additionalContext {
                category
                id
                content
                metadata
              }
            } 
          }
        }
      }
    }

Related to #489304 (closed)

Merge request reports