-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Page templating prototype #87
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aem/ui.apps/src/main/content/jcr_root/apps/composum-ai/prototype/prototype.html
Dismissed
Show dismissed
Hide dismissed
...um/package/src/main/content/jcr_root/libs/composum/pages/options/ai/prototype/prototype.html
Dismissed
Show dismissed
Hide dismissed
...ase/src/main/java/com/composum/ai/backend/slingbase/impl/ApproximateMarkdownServiceImpl.java
Fixed
Show fixed
Hide fixed
…n to avoid potential security risks
...ase/src/main/java/com/composum/ai/backend/slingbase/impl/ApproximateMarkdownServiceImpl.java
Dismissed
Show dismissed
Hide dismissed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
AI Page Templating : AI supported page creation in one step (experimental)
While the content creation dialog can support you for creating individual texts in a page, there might be a good use
case for AI when you have to create many pages of the same type. For example, a product page could consist of a
title, an attention grabber, an introduction, a list of features, a call to action, or the AIDA framework. With our
AI Page templating you can create a template page that contains prompts (instructions) to create suggestions for all of
these texts in the page, and when creating a new page from that template you supply the AI engine with the
background information as source to generate the content with texts based on these prompts.
The Composum AI contains an experimental feature for this: it works, but further improvements and changes are likely.
Please try it out; you are invited to use it! Please give us feedback
on what you think about it and what you would like to see improved!
How a template page looks like
Any normal page can be used as template page. However, instead of a normal text you can also put prompts into every
text field by starting the text with the marker
PROMPTFIELD:
and then the instructions. For example, you couldhave a text field with the content
PROMPTFIELD: single sentence invitation to check out the product
. Whenfilling in the page texts, the AI will later replace the prompt with the generated text, based on the supplied
source information. There are other markers:
PROMPTFIELD:
PROMPTFIELD#ID:
SOURCEURL(url)
PAGEPROMPT:
How to create a page from a template
You have to copy the template page with the normal editor to the desired page location. Then you can trigger the
Composum AI to collect the prompts from the page, supply it with the source information and have the language model
generate the texts.
To trigger this creation process there is a mini application 'AI Templating' linked at the protoype lists:
You have to enter the path to the page and either enter an URL that has text information that gives all needed
background information for the texts, or you can paste the text directly into a "Background information" field.
The "Replace prompts" button will then replace the prompts in the page with the generated texts. (That can take a
minute or two.) The "Reset to Prompts" button will reset the page to the original prompts, which are saved in the
page itself. Thus, you can experiment and improve the instructions you give to the AI.
Requirements
The templating engine needs a model with good reasoning capabilities. OpenAI's gpt-3.5-turbo often fails to follow
the instructions, so a model with better capabilities, like gpt-4o, is needed. This can be configured as the "High
intelligence model" in the Composum AI configuration - see the configuration documentation for the
[AEM variant(aem-variant/configuration.md) or Composum Pages variant.
Caution: the OpenAI API key has to have access to GPT-4 models.
If you use URLs to supply the AI with background information, you have to add appropriate URL whitelisting in the
Composum AI Approximate Markdown Service Configuration
since accessing URLs is disabled by default for securityreasons.
Further extensions: