Class AemAIConfigurationPlugin

  • All Implemented Interfaces:
    com.composum.ai.backend.slingbase.AIConfigurationPlugin

    public class AemAIConfigurationPlugin
    extends Object
    implements com.composum.ai.backend.slingbase.AIConfigurationPlugin
    Implements AEM specific methods of AIConfigurationPlugin.
    • Field Detail

      • TITLE_ATTRIBS

        public static final List<String> TITLE_ATTRIBS
        Possible attributes we use for the prompt name.
      • TEXT_ATTRIBS

        public static final List<String> TEXT_ATTRIBS
        Possible atttributes we use for the prompt text.
    • Constructor Detail

      • AemAIConfigurationPlugin

        public AemAIConfigurationPlugin()
    • Method Detail

      • getGPTPromptLibraryPathsDefault

        @Nullable
        public com.composum.ai.backend.slingbase.model.GPTPromptLibrary getGPTPromptLibraryPathsDefault()
        Specified by:
        getGPTPromptLibraryPathsDefault in interface com.composum.ai.backend.slingbase.AIConfigurationPlugin
      • getGPTConfigurationMap

        @Nullable
        public Map<String,​String> getGPTConfigurationMap​(@Nonnull
                                                               org.apache.sling.api.SlingHttpServletRequest request,
                                                               @Nullable
                                                               String mapPath,
                                                               @Nullable
                                                               String languageKey)
        Specified by:
        getGPTConfigurationMap in interface com.composum.ai.backend.slingbase.AIConfigurationPlugin
      • determineLanguageResource

        protected org.apache.sling.api.resource.Resource determineLanguageResource​(org.apache.sling.api.resource.Resource resource,
                                                                                   String languageKey)
      • descendantsStream

        @Nonnull
        public static Stream<org.apache.sling.api.resource.Resource> descendantsStream​(@Nullable
                                                                                       org.apache.sling.api.resource.Resource resource)
        Returns a stream that goes through all descendants of a resource, parents come before their children.
        Parameters:
        resource - a resource or null
        Returns:
        a stream running through the resource and it's the descendants, not null