Skip to content

feat(agents): add prompts for explain code tool

What does this merge request do and why?

Agent definition for duo chat explain code tool

This MR copies this prompt to AI Gateway. When v1/agents/chat/explain_code endpoint is requested, it'll build the prompt on AI Gateway and send it to LLM.

Related:

Test

Perform POST v1/agents/chat/explain_code with the following params:

{
  "params": {
  "language_info": "Ruby",
  "file_content": "puts 'hello'",
  "selected_text": "puts 'hello'",
  "input": "puts 'hello'"
  },
  "stream": false
}

Or

  • Run AI Gateway with Anthropic debug: ANTHROPIC_LOG=debug poetry run ai_gateway
  • Enable prompt_migration_explain_code feature flag on Rails
  • Perform /explain slash command in Duo Chat
  • Verify that v1/agents/chat/explain_code endpoint is called
  • Verify that the correct prompt is sent to Anthropic
Edited by Igor Drozdov

Merge request reports

Loading