Interface AITemplatingService
-
- All Known Implementing Classes:
AITemplatingServiceImpl
public interface AITemplatingService
Experimential service to provide page templating functionality: a page / component contains various prompts in it's properties which are replaced by the response of the AI. Status: experimential: don't use this in production yet, changes are very likely.- See Also:
- "10PageTemplating.md"
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
replacePromptsInResource(org.apache.sling.api.resource.Resource resource, String additionalPrompt, List<URI> additionalUrls, String backgroundInformation)
Replaces all prompts in the resource with the response of the AI.boolean
resetToPrompts(org.apache.sling.api.resource.Resource resource)
Undo #replacePromptsInResource.
-
-
-
Method Detail
-
replacePromptsInResource
boolean replacePromptsInResource(org.apache.sling.api.resource.Resource resource, String additionalPrompt, List<URI> additionalUrls, String backgroundInformation) throws URISyntaxException, IOException
Replaces all prompts in the resource with the response of the AI.- Parameters:
resource
- the resource to replace the prompts inadditionalPrompt
- optionally, an additional prompt to add to the AI requestadditionalUrls
- optionally, additional URLs with background information to provide data to the AIbackgroundInformation
- optionally, additional background information to provide data to the AI (not a prompt!)- Returns:
- true if the resource was changed, false if it was not changed; no commit yet.
- Throws:
URISyntaxException
IOException
-
resetToPrompts
boolean resetToPrompts(org.apache.sling.api.resource.Resource resource) throws org.apache.sling.api.resource.PersistenceException
Undo #replacePromptsInResource. Not commited yet.- Returns:
- true if the resource was changed, false if it was not changed.
- Throws:
org.apache.sling.api.resource.PersistenceException
-
-