Skip to content

Switch to Anthropic for ZeroShot agent

Nicolas Dular requested to merge nd/anthropic-agent into master

What does this MR do and why?

Switch to Anthropic for ZeroShot agent

This changes the client we inject for the ZeroShot agent to Anthropic and fixes a small bug with a namespaced translation string.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Set up the local environment for Anthropic https://docs.gitlab.com/ee/development/ai_features.html#test-ai-features-locally
  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