Table of contents


Official Content

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:

SendFlowTriggers

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.

Sample

&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)

GetFlowTriggers

Returns a collection of Triggers of a particular Flow.

Chatbot.Flows.GetFlowTriggers(&Instance, &Flow, &Messages, &Triggers)

Sample

&Flow = !"FreeTrips" //Name of the Flow
&Instance = !"Citizen" //Name of the instance
&Triggers = Chatbot.Flows.GetFlowTriggers(&Instance, &Flow, &Messages)

DeleteFlowTriggers

Deletes a collection of Triggers of a Flow.

Chatbot.Flows.DeleteFlowTriggers(&Instance, &Triggers, &Flow, &Messages)

Sample

&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)
Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant