Interface AIConfigurationPlugin
-
- All Known Implementing Classes:
OsgiAIConfigurationPluginImpl
,OsgiAIPromptlibConfigurationPluginImpl
,SlingCaConfigPluginImpl
public interface AIConfigurationPlugin
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default List<GPTPermissionConfiguration>
allowedServices(org.apache.sling.api.SlingHttpServletRequest request, String contentPath)
Determines the allowed services based on the provided request, content path, and editor URL.default GPTConfiguration
getGPTConfiguration(org.apache.sling.api.resource.ResourceResolver resourceResolver, String contentPath)
Reads the GPTConfiguration from sling context aware configurations.default Map<String,String>
getGPTConfigurationMap(org.apache.sling.api.SlingHttpServletRequest request, String mapPath, String languageKey)
default GPTPromptLibrary
getGPTPromptLibraryPaths(org.apache.sling.api.SlingHttpServletRequest request, String contentPath)
Reads the GPTPromptLibrary from sling context aware configurations or OSGI configurations, falling back to default values.default GPTPromptLibrary
getGPTPromptLibraryPathsDefault()
Returns the default paths forgetGPTPromptLibraryPaths(SlingHttpServletRequest, String)
.
-
-
-
Method Detail
-
allowedServices
@Nullable default List<GPTPermissionConfiguration> allowedServices(@Nonnull org.apache.sling.api.SlingHttpServletRequest request, @Nonnull String contentPath)
Determines the allowed services based on the provided request, content path, and editor URL.- Parameters:
request
- The SlingHttpServletRequest representing the current request.contentPath
- The path of the content being edited.- Returns:
- A set of allowed services; null if this plugin doesn't implement this method.
- See Also:
GPTPermissionInfo.SERVICE_CATEGORIZE
,GPTPermissionInfo.SERVICE_CREATE
,GPTPermissionInfo.SERVICE_SIDEPANEL
,GPTPermissionInfo.SERVICE_TRANSLATE
-
getGPTConfiguration
@Nullable default 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/- Returns:
- if the configuration could be determined we return it, otherwise null.
- Throws:
IllegalArgumentException
- if none of the paths is a /content/ path.
-
getGPTPromptLibraryPaths
@Nullable default GPTPromptLibrary getGPTPromptLibraryPaths(@Nonnull org.apache.sling.api.SlingHttpServletRequest request, @Nullable String contentPath)
Reads the GPTPromptLibrary from sling context aware configurations or 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.
-
getGPTPromptLibraryPathsDefault
@Nullable default GPTPromptLibrary getGPTPromptLibraryPathsDefault()
Returns the default paths forgetGPTPromptLibraryPaths(SlingHttpServletRequest, String)
.
-
-