java.lang.Object
fr.paris.lutece.plugins.wiki.modules.ai.service.chat.AiFeatureService

@ApplicationScoped public class AiFeatureService extends Object
Service for managing AI features.
  • Constructor Details

    • AiFeatureService

      public AiFeatureService()
  • Method Details

    • getAllFeatures

      public List<AiFeature> getAllFeatures()
      Retrieves all active features.
      Returns:
      the list of all active AI features
    • getFeaturesByType

      public List<AiFeature> getFeaturesByType(String strType)
      Retrieves features by type.
      Parameters:
      strType - the feature type
      Returns:
      the list of AI features matching the type
    • executeFeature

      public void executeFeature(int nFeatureId, String strText, dev.langchain4j.model.chat.response.StreamingChatResponseHandler handler)
      Executes an AI feature with the provided text using streaming.
      Parameters:
      nFeatureId - the ID of the feature to execute
      strText - the text to process
      handler - the streaming response handler
      Throws:
      IllegalArgumentException - if the feature is not found
      IllegalStateException - if the feature is not active
    • editSelection

      public void editSelection(String strText, List<EditStep> steps, dev.langchain4j.model.chat.response.StreamingChatResponseHandler handler)
      Rewrites a selection with the model, as a conversation: the first step applies a feature or an instruction to the selection, each next step refines the previous answer.
      Parameters:
      strText - the selected Markdown
      steps - the steps, the last one being the request to run
      handler - the streaming response handler
      Throws:
      IllegalArgumentException - if a feature is not found
      IllegalStateException - if a feature is not active