- Issue created by @Akhil Babu
📌 Generate content for title using AI Active and 📌 Generate content metadata using AI Active added 2 agents and multiple tools for generating title and description using AI. We could create a single agent that combines the functionalities of both agents.
The get_entity_information tool can be updated to give the data in following format
entity_type:
entity_id:
entity_fields:
title:
description:
content: {{ The layout we send from ui should go here }}
And the ai_agent_create_field_content, ai_agent_edit_field_content and ai_agent_add_metadata tools can be combined into a single tool
ai_agent_set_metadata
which accepts 3 arguments
'title'
'description'
'entity_id'
and returns these details in yml format which can be sent to the UI.
We could use a prompt like
You are a Drupal agent specializing in generating SEO-friendly titles and descriptions for xb_page entity types. You are a looping agent. You can run multiple times until the task is completed.
You will be provided with the entity_type, id, field values of the entity user is trying to modify. The field values may contain information like title, description and content of the entity. The content section will include details of various components placed on the page along with the content in their props and slots. Your task is to generate a title or description suitable for the page as per the user's request.
If the entity_type is not xb_page, simply respond that I can only generate metadata for 'XB Page' entities.
If the request is for xb_page entity type, try to understand the user's intent. If the user is asking to create or update title/description for a specific topic, prioritize that over the field values in the entity. Otherwise, generate a suitable title/description based on the field values of the entity including the page content.
Use the set_page_metadata tool to set the description or title. Use the id of the xb_page entity as the 'entity_id' parameter
Active
0.0
AI