Package org.opencms.ai
Class CmsAiContentTranslation
java.lang.Object
org.opencms.ai.CmsAiContentTranslation
- All Implemented Interfaces:
I_CmsContentTranslator,I_CmsConfigurationParameterHandler
LLM implementation of the I_CmsContentTranslator interface.
Reads the LLM credentials from a JSON file whose file system path is passed via the 'config' configuration parameter.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringParameter from which the config file path is read.Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfigurationParameter(String paramName, String paramValue) Adds a configuration parameter to this parameter configurable class instance.Returns the parameters of this configurable class instance, ornullif the class does not need any parameters.Returns a fresh content augmentation object for doing the actual translation work.voidInitializes a configuration after all parameters have been added.voidinitialize(CmsObject cms) Initializes the content translator with an admin CmsObject.booleanisEnabled(CmsObject cms, CmsADEConfigData config, CmsFile file) Checks if the translation should be enabled for the current context.
-
Field Details
-
PARAM_CONFIG_FILE
Parameter from which the config file path is read.- See Also:
-
-
Constructor Details
-
CmsAiContentTranslation
public CmsAiContentTranslation()
-
-
Method Details
-
addConfigurationParameter
Description copied from interface:I_CmsConfigurationParameterHandlerAdds a configuration parameter to this parameter configurable class instance.- Specified by:
addConfigurationParameterin interfaceI_CmsConfigurationParameterHandler- Parameters:
paramName- the name of the parameterparamValue- the value for the parameter- See Also:
-
getConfiguration
Description copied from interface:I_CmsConfigurationParameterHandlerReturns the parameters of this configurable class instance, ornullif the class does not need any parameters.- Specified by:
getConfigurationin interfaceI_CmsConfigurationParameterHandler- Returns:
- the parameters of this configurable class instance,
or
nullif the class does not need any parameters - See Also:
-
getContentAugmentation
Description copied from interface:I_CmsContentTranslatorReturns a fresh content augmentation object for doing the actual translation work.- Specified by:
getContentAugmentationin interfaceI_CmsContentTranslator- Returns:
- the content augmentation object
- See Also:
-
initConfiguration
Description copied from interface:I_CmsConfigurationParameterHandlerInitializes a configuration after all parameters have been added.- Specified by:
initConfigurationin interfaceI_CmsConfigurationParameterHandler- Throws:
CmsConfigurationException- if something goes wrong- See Also:
-
initialize
Description copied from interface:I_CmsContentTranslatorInitializes the content translator with an admin CmsObject.If the translator is already initialized, this should do nothing.
- Specified by:
initializein interfaceI_CmsContentTranslator- Parameters:
cms- an admin CmsObject- See Also:
-
isEnabled
Description copied from interface:I_CmsContentTranslatorChecks if the translation should be enabled for the current context.- Specified by:
isEnabledin interfaceI_CmsContentTranslator- Parameters:
cms- the CMS contextconfig- the currently active ADE configurationfile- the edited file- Returns:
- true if the translation should be enabled
- See Also:
-