Skip to content

Add chat aiAction mutation

Nicolas Dular requested to merge nd/add-general-chat-action into master

What does this MR do and why?

This introduces the chat action as part of the aiAction mutation. It directly calls the ZeroShot agent. It is a very basic mutation and the output of the Agent is not helpful yet as we're still missing other tools.

There will be more work in the follow-up to improve the response from the chat. It should just cover the basics of having a chat mutation available.

Screenshots or screen recordings

chat_mutation

Before After

How to set up and validate locally

  1. Set up AI feature locally https://docs.gitlab.com/ee/development/ai_features.html#test-ai-features-locally with Vertex enabled
  2. Enable the feature flag Feature.enable(:gitlab_duo)
  3. Test it with the GraphQL mutation and message history:
query messages {
  aiMessages {
    nodes {
      id
      requestId
      content
      errors
      role
    }
  }
}

mutation chat {
  aiAction(input:{chat:{resourceId:"gid://gitlab/Issue/645", content:"Summarize the comments"}}) {
    requestId
    errors
  }
}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Nicolas Dular

Merge request reports