Skip to content

feat: introduce new agent - [#3517117]

This PR introduces a new AI agent, the BlockContentAgent, designed to handle tasks related to Drupal block content types. Reviewers should concentrate on the following specific changes:

  • prompts/block_content_agent/answerQuestion.yml:
    • Creation of a new prompt file answerQuestion.yml tailored for answering questions about block content types.
    • Review the prompt's introduction, formats, and one_shot_learning_examples to ensure they are clear, accurate, and cover various question types.
  • prompts/block_content_agent/determineBlockContentTypeTask.yml:
    • Creation of a new prompt file determineBlockContentTypeTask.yml to analyze user input and determine the intended action (create, edit, delete, information).
    • Review the prompt's introduction, possible_actions, formats, and one_shot_learning_examples to ensure they are comprehensive and align with the agent's capabilities.
  • src/Plugin/AiAgent/BlockContentAgent.php:
    • Creation of the BlockContentAgent class, which extends AiAgentBase and implements AiAgentInterface.
    • Review the class properties, including $questions, $result, $data, and $taskType.
    • Examine the create method and its dependency injection.
    • Verify the correctness of methods like getId, agentsNames, and agentsCapabilities, paying close attention to the agent's name, ID, description, inputs, and outputs.
    • Analyze the implementation of methods such as setData, isAvailable, isNotAvailableMessage, getRetries, getData, answerQuestion, getHelp, and hasAccess, ensuring they are appropriate for the agent's functionality.
    • Critically review the determineSolvability method and the logic for determining the task type.
    • Carefully examine the solve method and the methods it calls (createBlockContentType, editBlockContentType), ensuring correct handling of create, edit, and other actions. Note the placeholder for delete.
    • Assess the checkRequirements method and its implementation.
    • Analyze helper methods like getBlockContentTypes, getBlockContentTypesAsString, getVerboseBlockContentTypesAsString, and doesBlockContentTypeExist, verifying their accuracy and efficiency.

Key Review Focus:

  • Prompt definitions and their effectiveness in guiding the AI.
  • Agent capabilities and their accurate representation in the code.
  • Correctness of the agent's logic for handling different tasks.
  • Adherence to Drupal coding standards and best practices.
Edited by Andrii Podanenko

Merge request reports

Loading