Hey there
The use case is this: if user input has more than one sentence or more than x words (let’s say 20 or 30), to pass the input to a LLM to rephrase it in one sentence and up to x words, and then use it further.
This will avoid the triggering of “User input is too long” flow (which can be very annoying to appear after spending some time to describe a problem), and will solve the issue with many sentences in one input by preserving the full context of user request in one sentence (some users are quite descriptive in their inputs).
Now the issue I have is that with a pre-processing script I can overwrite user input by using “.setUserInputText()", but at this step I don’t know should I do it or not, because ".getUserInputWords().length” and “_.getSentenceCount()” are not ready yet - they will be available after processing and before matching.
Using a pre-match script also appeared not an option for me, since “.getUserInputWords().length" and ".getSentenceCount()” are now available at this step, but user input text cannot be manipulated anymore - it is set to “read-only” before matching.
In order to achieve the use case, I have a request to help me get input words count and sentence count on the pre-processing step.
I can use a groovy script to achieve this, but most probably the result will be different from the one that Teneo engine does, and this may compromise the behavior.
Is it possible for you to share the part of the NLP where UserInputWords and SentenceCount are populated, so I can use them in the pre-procesing and get consistents result with such implementation?