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 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 in
        additionalPrompt - optionally, an additional prompt to add to the AI request
        additionalUrls - optionally, additional URLs with background information to provide data to the AI
        backgroundInformation - 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