Class IncludesHandler
java.lang.Object
sk.iway.iwcm.components.ai.providers.IncludesHandler
Provides logic to hnalde INCLUDES in strings. To replace them with placeholders, then swap them back. Even when output is parse to line.
-
Constructor Summary
ConstructorsConstructorDescriptionIncludesHandler
(Map<Integer, String> replacedIncludes) IncludesHandler
(Map<Integer, String> replacedIncludes, Integer milliSleep) -
Method Summary
Modifier and TypeMethodDescriptionstatic final String
addProtectedTokenInstructionRule
(String instructions) void
handleLine
(String line, BufferedWriter writer) USing logic with buffer, method is trying find placeholder __LOCK_X__, swap them with includes and without waiting for whole text etite/flush parts.replaceIncludesWithPlaceholders
(InputDataDTO inputData) static final String
returnIncludesToPlaceholders
(String responseText, Map<Integer, String> replacedIncludes)
-
Constructor Details
-
IncludesHandler
- Parameters:
replacedIncludes
-
-
IncludesHandler
- Parameters:
replacedIncludes
-milliSleep
- - in milliseconds how long wait between flush
-
-
Method Details
-
handleLine
USing logic with buffer, method is trying find placeholder __LOCK_X__, swap them with includes and without waiting for whole text etite/flush parts.- Parameters:
line
-writer
-- Throws:
IOException
-
replaceIncludesWithPlaceholders
-
addProtectedTokenInstructionRule
-
returnIncludesToPlaceholders
-