Categories:
Triage recognizer middleware
Description of triage-recognizer-middleware, responsible for calling an external API in an attempt to obtain the user’s intent.
Enabling the triage recognizer
The triage-recognizer-middleware is an optional recognizer that can be added to the environment variable AURA_ACTIVE_MIDDLEWARES to enable it.
AURA_ACTIVE_MIDDLEWARES=TriageRecognizerMiddleware
Once enabled, the middleware will only run if the following conditions are met:
- There is no intent already recognized in the context.
- The intent is included in the list of intents defined in the environment variable
AURA_INTENTS_NONE. By default, this variable contains the value['None', 'intent.none', 'intent.tv.none'].
Adding the necessary configuration for the channel
To use this recognizer, it is necessary to add the configuration for the channel in the channel collection in the aura-configuration-api.
The configuration must include the applicationId and presetId for the TriageRecognizer in the atria.recognizers object.
For example, if the channel is movistar-plus, the configuration should look like this:
{
"name": "movistar-plus",
"prefix": "mp",
"atria": {
"recognizers": {
"TriageRecognizer": {
"applicationId": "816bdab6-3ea3-4a77-bdea-12945d6d7053",
"presetId": "67cb30a2-aec7-448c-a2a6-18faaa9d1820"
}
}
}
}
How the triage recognizer works
The triage-recognizer-middleware is responsible for calling an external API, ATRIA, to obtain the user’s intent using a Large Language Model (LLM) system.
The triage-recognizer-middleware uses the AiService to call the Atria generative API with the message received in the request and the configuration defined for the channel in the channel collection in the aura-configuration-api (see the section Adding the necessary configuration for the channel).
If triage middleware is enabled but the channel does not contain the config for the TriageRecognizer, the middleware will not be executed.
For each call, the previous session information associated with the user is sent, if it exists. The session information is stored in the context for future requests.
Finally, the intent is extracted from the response received from ATRIA and fills the IntentResult with the recognized intent.