Skip to content

Rename additional context fields in graphql api

What does this MR do and why?

Resolves #481548 (closed)

This MR makes the following changes to the fields in the additional context api:

  • renames name -> id
  • renames type -> category
  • adds metadata - a new field with JSON type

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-03_at_1.37.05_PM

How to set up and validate locally

Run gdk and go to http://gdk.test:3000/-/graphql-explorer and paste the following query, then ensure a message is sent on the UI of Duo Chat and there are no errors:

mutation {
  aiAction(
    input: {
      chat: {
        content: "Explain me this again!", 
        additionalContext: [
          {
            category: SNIPPET, 
            id: "hello world", 
            content: "puts 'Hello, world'", 
            metadata: {
              rando:"json object"
            }
          }
        ]
      }
    }
  ) {
    clientMutationId
    errors
  }
}
Edited by Missy Davies

Merge request reports

Loading