How to embed content into a page template

Hello, I’m creating a shopify app that generates content for pages, however i now want to embed that content into a page template, but I’m not understanding how I can do that. The user can select the desired template in the moment of generation however when i create the page, since the content is going on the body section its showing the content and then the page. The purpose should be show the content generated within the template. Can anyone help?

Hi thank you for the answer!! I will try to search more on metafields to see what I can do however, if I want the content to follow the exact layout of the template, will that work? I’m generating content with AI which means it just gives me the whole page, don’t I need to send the code of the template to the AI so it knows the structure of the output? So it can generate the layout of the new page according to the template.

Hopefully this made sense and I could explain myself correctly!!