Overview

Here are some refactoring that can be done as a part of this issue:

  1. Issues #3529313: Add `getStructuredOutput()` method to ExecutableFunctionCallInterface for returning parsed output and #3529310: Improve ai_agents module API to simplify tool result handling introduced new methods that, when implemented, will help reduce code complexity in the current XbBuilder::render method. Incorporating these methods is recommended to simplify the codebase.

    Additionally, as per #3532026: Set TaskInterface and setTask as deprecated for 2.0.0, the Task interface is deprecated. Therefore, the solution provided in https://git.drupalcode.org/project/experience_builder/-/merge_requests/1... should be adopted.

  2. Refactor the AI Orchestrator agent to make it simple.
  3. We don't need field_name in CreateFieldContent tool and also it would make sense to rename the CreateFieldContent and EditFieldContent for now as they only create content for title. We can further generalise it if we add any new feature.
  4. Instead of creating a new file for props schema we can add the hardcoded values in the default context for suitable agent that uses it(in this case it is component agent)

Proposed resolution

User interface changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

narendrar created an issue. See original summary.

utkarsh_33’s picture

Title: Refactor XbBuilder::render for XB AI » Refactor XB AI module
Issue summary: View changes
utkarsh_33’s picture

Version: 0.x-dev » 1.x-dev

utkarsh_33’s picture

Assigned: Unassigned » utkarsh_33

This still has some work left to do and the code in this is not review ready so assigning it to me for now.

utkarsh_33’s picture

Assigned: utkarsh_33 » Unassigned

Project: Experience Builder » Drupal Canvas

Experience Builder has been renamed to Drupal Canvas in preparation for its beta release. You can now track issues on the new project page.

rakhimandhania’s picture

rakhimandhania’s picture

akhil babu’s picture

The agents work entirely based on the parameters sent by the frontend, such as current_layout, entity_type, request_id etc. We should also validate that all required parameters are present in the request body before invoking the orchestrator, and consider throwing an exception if any are missing.