The Chatbot generator API allows you to Initialize entity values in the AI provider, and also adds the possibility to keep the training phrases (examples) for the intents recognition updated in the Provider.
The training examples are called Trigger Messages at the Conversational Flows object, and they can be configured from the Trigger Messages property of each Flow.
Besides configuring the training examples there, they can be obtained, added and deleted, using the Chatbot Generator API (to avoid editing the Conversational Flows instance to make any change at production time).
This document details the methods to be used:
It allows you to send to the NLP Provider some triggers for a specific Flow.
Chatbot.Flows.SendFlowTriggers(&Instance, &Triggers, &Flow, &Messages)
Where:
&Instance
Is of Character type
&Triggers
Is a Varchar collection
&Flow
Is of Character type
&Messages
Is of Messages data type. See Chatbot Generator common errors and solutions to have details about the values which can take the &Messages parameter.
&Triggers.Add(!"rides at no cost")
&Triggers.Add(!"Free journey")
&Flow = !"FreeTrips" //Name of the Flow
&Instance = !"Citizen" //Name of the instance
Chatbot.Flows.SendFlowTriggers( &Instance, &Triggers, &Flow, &Messages)
Returns a collection of Triggers of a particular Flow.
Chatbot.Flows.GetFlowTriggers(&Instance, &Flow, &Messages, &Triggers)
&Flow = !"FreeTrips" //Name of the Flow
&Instance = !"Citizen" //Name of the instance
&Triggers = Chatbot.Flows.GetFlowTriggers(&Instance, &Flow, &Messages)
Deletes a collection of Triggers of a Flow.
Chatbot.Flows.DeleteFlowTriggers(&Instance, &Triggers, &Flow, &Messages)
&Provider = Chatbot.Conversational.Watson
&Flow = !"FreeTrips" //Name of the Flow
&Instance = !"Citizen" //Name of the instance
&Triggers.Add(!"rides at no cost")
Chatbot.Flows.DeleteFlowTriggers(&Instance, &Triggers, &Flow, &Messages)