Class AiFeatureService
java.lang.Object
fr.paris.lutece.plugins.wiki.modules.ai.service.chat.AiFeatureService
Service for managing AI features.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoideditSelection(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.voidexecuteFeature(int nFeatureId, String strText, dev.langchain4j.model.chat.response.StreamingChatResponseHandler handler) Executes an AI feature with the provided text using streaming.Retrieves all active features.getFeaturesByType(String strType) Retrieves features by type.
-
Constructor Details
-
AiFeatureService
public AiFeatureService()
-
-
Method Details
-
getAllFeatures
Retrieves all active features.- Returns:
- the list of all active AI features
-
getFeaturesByType
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 executestrText- the text to processhandler- the streaming response handler- Throws:
IllegalArgumentException- if the feature is not foundIllegalStateException- 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 Markdownsteps- the steps, the last one being the request to runhandler- the streaming response handler- Throws:
IllegalArgumentException- if a feature is not foundIllegalStateException- if a feature is not active
-