Class LocalTranslateService
java.lang.Object
sk.iway.iwcm.components.ai.providers.LibrarySupportLogic
sk.iway.iwcm.components.ai.providers.local.translate.LocalTranslateService
- All Implemented Interfaces:
AiAssitantsInterface,AiInterface
@Service
@Conditional(LocalAiAvailableCondition.class)
public class LocalTranslateService
extends LibrarySupportLogic
implements AiAssitantsInterface
Adapts the local M2M100 provider to CMS assistants and enforces explicitly configured plain-text translation.
-
Nested Class Summary
Nested classes/interfaces inherited from class sk.iway.iwcm.components.ai.providers.LibrarySupportLogic
LibrarySupportLogic.LiteralTranslationOptionsResolver -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLocalTranslateService(com.webjetcms.ai.AiClient aiClient, WebjetAiConfigurationService configurationService, LocalTranslateProvider localTranslateProvider) -
Method Summary
Modifier and TypeMethodDescriptiongetFieldsToShow(String action) booleanisInit()voidprepareBeforeSave(AssistantDefinitionEntity assistantEntity) Validates translation instructions and applies the fixed local translation settings.voidMethods inherited from class sk.iway.iwcm.components.ai.providers.LibrarySupportLogic
configurationService, getAiImageResponse, getAiResponse, getAiStreamResponse, getBonusHtml, getSupportedModels, validatePromptExpansionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface sk.iway.iwcm.components.ai.providers.AiInterface
configure, getApiKey, getImageNameModel
-
Field Details
-
DEFAULT_MODEL
- See Also:
-
-
Constructor Details
-
LocalTranslateService
@Autowired public LocalTranslateService(com.webjetcms.ai.AiClient aiClient, WebjetAiConfigurationService configurationService, LocalTranslateProvider localTranslateProvider)
-
-
Method Details
-
getProviderId
- Specified by:
getProviderIdin interfaceAiAssitantsInterface- Specified by:
getProviderIdin interfaceAiInterface
-
getTitleKey
- Specified by:
getTitleKeyin interfaceAiInterface
-
isInit
public boolean isInit()- Specified by:
isInitin interfaceAiAssitantsInterface- Specified by:
isInitin interfaceAiInterface- Overrides:
isInitin classLibrarySupportLogic
-
getFieldsToShow
- Specified by:
getFieldsToShowin interfaceAiAssitantsInterface
-
prepareBeforeSave
Validates translation instructions and applies the fixed local translation settings.- Specified by:
prepareBeforeSavein interfaceAiAssitantsInterface- Parameters:
assistantEntity- assistant configuration being prepared for persistence- Throws:
IllegalStateException- if the instructions do not contain valid translation options
-
setProviderSpecificOptions
public void setProviderSpecificOptions(DatatablePageImpl<AssistantDefinitionEntity> page, Prop prop) - Specified by:
setProviderSpecificOptionsin interfaceAiAssitantsInterface
-