--- AI TRACKER METADATA ---
Update Summary: This has been rescoped to just the title. The larger scoped version of this will likely be solved by #3533079: Introduce AI Agents and tools to create entire page templates using available component entities
Check-in Date: MM/DD/YYYY (US format) [When we should see progress/get an update]
Due Date: MM/DD/YYYY (US format) [When the issue should be fully completed]
Blocked by: [#XXXXXX] (New issues on new lines)
Additional Collaborators: @username1, @username2
AI Tracker found here: https://www.drupalstarforge.ai/
--- END METADATA ---
Overview
When creating a new piece of content the user must be able to create content using AI and insert them into multiple fields.
Proposed resolution
User interface changes
Issue fork experience_builder-3530709
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
Comment #2
narendrarComment #4
utkarsh_33 commentedSo here is the update what's happening in this MR at this point.
When a user gives a prompt like
Then the response that comes to the front-end is:-
The
messagepart of the response will go in the chatbot that user interacts with.As we can see that the response contains the content along with the field name with which it is associated or needs to be inserted.
Now the question is how can we update the UI.Considering the example of the two fields that are there in the response i.e body and title how can we insert the content in respective fields.
Comment #5
balintbrewsDoes the word "structured" in the issue title refer to adding content to fields of the
xb_pageentity type other than XB's own field that stores the component tree (thecomponentsbase field on thexb_pageentity type) which we sometimes refer to as the canvas?From that response it seems like that
titlewould go in thetitlefield of the entity. For that and any other fields on the entity (other thancomponents) — see what's available in\Drupal\experience_builder\Entity\Page—, you can use thesetPageDataaction creator fromsrc/features/pageData/pageDataSlice.ts.What about
body? If the goal is to fill in fields other thancomponents, then I think you should provide the information to the agent about what kind of fields are available to generate content for. There is no body field, but content could be generated for other fields in a similar fashion. If that content is meant to be forcomponents/canvas, then you would need to tell the agent about the available components (SDCs, JavaScript components, and blocks) that can be used, and have it generate the component tree.Comment #6
utkarsh_33 commentedI assume this issue is only for adding content on entity fields (including body), we can have a separate issue for components when needed. @tim.plunkett and @lauriii can you please confirm before I make further progress on this?
Comment #7
utkarsh_33 commentedSo here's what we assumed and are trying to do:-
bodyandtitleit could be both thenode entitytype as well asxb_page.I have pushed the code to update the page data in this commit after which tried to update both types of entity but its not working.but unfortunately it also didn't work.
I think we are targeting to update the entity fields as a part of this issue for now not the component's base field.We can have a follow-up for that if we want.
I also tried to see the form state (for node entity) and the key, values for the form are a bit different from what's in the
xb_pageentity.There also i tried to update with some hardcoded values but it didn't update the values in the entity fields.If i am missing something please let me know how can i start digging more into the issue.
This is the structure of the form for node entity.
The following is the structure for xb_page entity:-
Comment #9
balintbrews#7: The payload expects the page data values to be keyed by strings. So do this instead:
Unfortunately, I don't think atomic updates like this will work without modifying the action
setPageDataaction creator. In our existing code we update the entire form state this way, seeformStateToStore()ininputBehaviors.tsx.Comment #10
utkarsh_33 commentedSo as per the discussion with @lauriii we agreed to the point that we only want to update the title field for the
xb_pageentity type.So this issue is scoped at updating the title field with the value generated by AI agent.Also we might need to make changes in
setPageDataaccording to what in @balintbrews mentioned in this comment.Also i want to highlight that this MR is capable of generating content for multiple fields at a time as demonstrated in #4 but for now we might just use this to update the title that to only for the
xb_pageentity.Comment #11
catia_penas commentedComment #12
catia_penas commentedComment #14
yautja_cetanu commentedComment #15
rakhimandhania commentedComment #16
rakhimandhania commented