Generate content for title using AI

Created on 25 June 2025, about 2 months ago

Overview

Create content for title field of xb_page entity using AI.

Proposed resolution

User interface changes

๐Ÿ“Œ Task
Status

Active

Version

0.0

Component

AI

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia utkarsh_33

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @utkarsh_33
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1433s
    #530774
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1195s
    #530787
  • Pipeline finished with Failed
    about 2 months ago
    #530798
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kunal.sachdev

    kunal.sachdev โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Canceled
    about 2 months ago
    Total: 164s
    #530838
  • Pipeline finished with Failed
    about 2 months ago
    Total: 2703s
    #530839
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1063s
    #530989
  • Pipeline finished with Failed
    about 2 months ago
    Total: 111s
    #530999
  • Pipeline finished with Failed
    about 2 months ago
    Total: 353s
    #531001
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1368s
    #531003
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1281s
    #531045
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States tim.plunkett Philadelphia
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1280s
    #531947
  • Pipeline finished with Failed
    about 2 months ago
    Total: 627s
    #532027
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1550s
    #532034
  • Pipeline finished with Failed
    about 2 months ago
    Total: 789s
    #532106
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1004s
    #532120
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1251s
    #532151
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 468s
    #532173
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1183s
    #532178
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1258s
    #532963
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia utkarsh_33

    So here's what the current state looks like:-

    1. The component creation and editing flow works fine(which includes the editing of the props for the components as well)
    2. The content creation flow also works 10/10 times and it creates the content correctly on any given topic and insert it correctly in the title field.
    3. The content editing flow only works 8/10 times which is causing this to push back a bit.I have attempted changing the prompt(and still trying it) so that before calling the editing tool it always get's the content related to the field(in our case it will always be title) that user want's to edit, but sometimes it fails.

    I'll keep trying to fix the issue that's coming while editing the title and will post any update soon.

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    @utkarsh_33 what are the prompts you are using for testing this?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia utkarsh_33

    So here's the update on how am i testing it along with the results:-
    Editing flow:-

    1. Lengthen/shorten title's content:-Working as expected
    2. Fix grammar for title:- Working as expected
    3. Elaborate title:- Working as expected
    4. Rephrase title:- Working as expected without further questions to the user.

    Content creation flow:-

    1. Create content on topic Drupal and insert in title field:- working as expected
    2. Add title on cricket/ Add content on title field for cricket :- working as expected (which was not working before)
    3. Generate title on topic Drupal:- working as expected

    I am not adding the component creation flow as those are already working.

    Re #6 : This problem of failing to edit content now is fixed and it almost(what ever i tested) works as expected.

    It would be great if someone can test this MR now.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia utkarsh_33

    There is a know problem in this which is this comment. It's because we only want the creation and editing flow to work with the xb_page entity for now as discussed with @lauriii.But the everting works as expected if we are on the xb_page entity.
    Will try to get a workaround for this ASAP.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 2833s
    #533078
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia utkarsh_33

    Handled the problem reported in #9 in this commit.
    Now things are working as expected so marking it NR for an initial round of testing or Code reviews.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 1011s
    #533127
  • First commit to issue fork.
  • Pipeline finished with Failed
    about 2 months ago
    Total: 919s
    #534985
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1119s
    #535001
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1256s
    #535015
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 160s
    #536012
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1182s
    #536014
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia utkarsh_33

    Here is the video demonstrating how the title is generated based on the content present on the page.

  • Pipeline finished with Canceled
    about 2 months ago
    Total: 3617s
    #536077
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1013s
    #536109
  • Pipeline finished with Failed
    about 2 months ago
    Total: 757s
    #536168
  • Pipeline finished with Failed
    about 2 months ago
    Total: 952s
    #536178
  • Pipeline finished with Failed
    about 2 months ago
    #536193
  • Pipeline finished with Canceled
    about 2 months ago
    #536199
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1194s
    #536208
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India

    Tried to test it manually and most of the functionality seems to be working fine but when we create a component (Could you create a hero banner component with some text, call-to-action button, and a background colour red) and try to update the title (Update title to say 'Welcome to drupal') of that component, it does not work as request goes to this agent which is wrong.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 1865s
    #537011
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1180s
    #537059
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia utkarsh_33

    I have tested to best of my knowledge and everything seems to be working fine.Marking it NR.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India

    Manually tested it with @utkarsh_33 and functionality is working as expected. Moving it to RTBC.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 1110s
    #537082
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1250s
    #537107
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 563s
    #538777
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1431s
    #538782
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia utkarsh_33

    I have rebased it with the changes from HEAD.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 8914s
    #540654
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akhil Babu Chengannur

    ๐Ÿ“Œ Generate content metadata using AI Active has already added a metadata generation agent for creating/editing page descriptions. So, couldn't we use the same agent to generate the title as well? Is it really necessary to create a new agent just for generating the title?

  • Pipeline finished with Failed
    about 1 month ago
    Total: 1241s
    #540821
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia utkarsh_33

    This change is not related to this MR but since @AkhilBabu made a valid point that we don't need that if we are using it in default information so removing it as a part of this issue only.If someone thinks that it should be done in a follow-up then happy to do that as well.This does not affect any existing functionality so i thought it's better to do that in this issue only.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 994s
    #540858
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akhil Babu Chengannur

    Thanks for the explanation @utkarsh_33. IMHO, this can be very simplified, in fact, merged with the metadata agent created in ๐Ÿ“Œ Generate content metadata using AI Active . That agent is solely for generating the description field value for the XB page entity type based on the page content or a given topic. The same agent could generate the title as well.

    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

    Not sure if I'm missing something here. Would love to hear your thoughts.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akhil Babu Chengannur

    Created a followup issue โœจ XB AI: Simplify metadata generation Active for #21

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia utkarsh_33

    Merging the latest changes from 0.x.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 3116s
    #542749
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States tim.plunkett Philadelphia
  • Pipeline finished with Success
    about 1 month ago
    Total: 822s
    #543028
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States tim.plunkett Philadelphia

    Merged, thanks all!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024