Interface AIConfigurationService
-
- All Known Implementing Classes:
AIConfigurationServiceImpl
public interface AIConfigurationService
This is the primary service interface that provides methods to check which AI services are allowed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GPTPermissionInfo
allowedServices(org.apache.sling.api.SlingHttpServletRequest request, String contentPath, String editorUrl)
Method to check which services are allowed, based on the path and editor URL provided.com.composum.ai.backend.base.service.chat.GPTConfiguration
getGPTConfiguration(org.apache.sling.api.resource.ResourceResolver resourceResolver, String contentPath)
Reads the GPTConfiguration from sling context aware configurations.Map<String,String>
getGPTConfigurationMap(org.apache.sling.api.SlingHttpServletRequest request, String mapPath, String languageCode)
Decodes the map from the given mapPath, as determined from the appropriate method ofgetGPTPromptLibraryPaths(SlingHttpServletRequest, String)
.GPTPromptLibrary
getGPTPromptLibraryPaths(org.apache.sling.api.SlingHttpServletRequest request, String contentPath)
Reads theGPTPromptLibrary
from sling context aware configurations, falling back to OSGI configurations, falling back to default values.
-
-
-
Method Detail
-
allowedServices
@Nullable GPTPermissionInfo allowedServices(@Nonnull org.apache.sling.api.SlingHttpServletRequest request, @Nonnull String contentPath, @Nonnull String editorUrl)
Method to check which services are allowed, based on the path and editor URL provided.- Parameters:
request
- the SlingHttpServletRequestcontentPath
- the content patheditorUrl
- the editor URL- Returns:
- information about allowed services
-
getGPTConfiguration
@Nullable com.composum.ai.backend.base.service.chat.GPTConfiguration getGPTConfiguration(@Nonnull org.apache.sling.api.resource.ResourceResolver resourceResolver, @Nullable String contentPath) throws IllegalArgumentException
Reads the GPTConfiguration from sling context aware configurations.- Parameters:
resourceResolver
- the resource resolvercontentPath
- if that's given we read the configuration for this path, otherwise we take the requests path, as long as it starts with /content/- Throws:
IllegalArgumentException
- if none of the paths is a /content/ path.
-
getGPTPromptLibraryPaths
@Nullable GPTPromptLibrary getGPTPromptLibraryPaths(@Nonnull org.apache.sling.api.SlingHttpServletRequest request, @Nullable String contentPath) throws IllegalArgumentException
Reads theGPTPromptLibrary
from sling context aware configurations, falling back to OSGI configurations, falling back to default values.- Parameters:
request
- the requestcontentPath
- if that's given we read the configuration for this path, otherwise we take the requests path, as long as it starts with /content/- Throws:
IllegalArgumentException
- if none of the paths is a /content/ path.
-
getGPTConfigurationMap
@Nullable Map<String,String> getGPTConfigurationMap(@Nonnull org.apache.sling.api.SlingHttpServletRequest request, @Nullable String mapPath, @Nullable String languageCode) throws IllegalArgumentException
Decodes the map from the given mapPath, as determined from the appropriate method ofgetGPTPromptLibraryPaths(SlingHttpServletRequest, String)
.- Throws:
IllegalArgumentException
-
-