Package com.composum.ai.aem.core.impl
Class AemAIConfigurationPlugin
- java.lang.Object
-
- com.composum.ai.aem.core.impl.AemAIConfigurationPlugin
-
- All Implemented Interfaces:
AIConfigurationPlugin
public class AemAIConfigurationPlugin extends Object implements AIConfigurationPlugin
Implements AEM specific methods ofAIConfigurationPlugin
.
-
-
Field Summary
Fields Modifier and Type Field Description static List<String>
TEXT_ATTRIBS
Possible atttributes we use for the prompt text.static List<String>
TITLE_ATTRIBS
Possible attributes we use for the prompt name.
-
Constructor Summary
Constructors Constructor Description AemAIConfigurationPlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Stream<org.apache.sling.api.resource.Resource>
descendantsStream(org.apache.sling.api.resource.Resource resource)
Returns a stream that goes through all descendants of a resource, parents come before their children.protected org.apache.sling.api.resource.Resource
determineLanguageResource(org.apache.sling.api.resource.Resource resource, String languageKey)
Map<String,String>
getGPTConfigurationMap(org.apache.sling.api.SlingHttpServletRequest request, String mapPath, String languageKey)
GPTPromptLibrary
getGPTPromptLibraryPathsDefault()
Returns the default paths forAIConfigurationPlugin.getGPTPromptLibraryPaths(SlingHttpServletRequest, String)
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.composum.ai.backend.slingbase.AIConfigurationPlugin
allowedServices, getGPTConfiguration, getGPTPromptLibraryPaths
-
-
-
-
Method Detail
-
getGPTPromptLibraryPathsDefault
@Nullable public GPTPromptLibrary getGPTPromptLibraryPathsDefault()
Description copied from interface:AIConfigurationPlugin
Returns the default paths forAIConfigurationPlugin.getGPTPromptLibraryPaths(SlingHttpServletRequest, String)
.- Specified by:
getGPTPromptLibraryPathsDefault
in interfaceAIConfigurationPlugin
-
getGPTConfigurationMap
@Nullable public Map<String,String> getGPTConfigurationMap(@Nonnull org.apache.sling.api.SlingHttpServletRequest request, @Nullable String mapPath, @Nullable String languageKey)
- Specified by:
getGPTConfigurationMap
in interfaceAIConfigurationPlugin
-
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
-
-