HowTo : Initialize entity values in the AI provider

Official Content

In order to initialize Chatbot Entity values (and their synonyms) in the AI provider, using the Chatbot generator, you just need to execute the following steps.

  1. Create a Data Provider or procedure which loads into an Structured Data Type Object the list of values for the entity you want to load in the AI provider.
  2. Call the "SendEntitiyValuesProvider" procedure (this procedure is an entry point which belongs to the Chatbot external module). In the Kb, you can see it under References - Chatbot module.
  3. image_2018523153216_1_png
     

Its signature is as follows:

parm(in:&SDTEntityValues, in:&Entity, in:&chatbotInstance, out:&Messages);

where

  • &SDTEntityValues is of SDTEntityValues data type. Here load all the entity values and it synonyms.

        image_201852315820_1_png

  • &Entity is varchar(40). The name of the Entity in the AI provider.
  • &chatbotInstance is varchar(256). The name of the Conversational Flows instance.
  • &Messages is an output parameter of Messages data type.

Sample

Take a look at the Citizen Service Chatbot sample, and open the "InitializeEntityValuesPrc" procedure.

In this example, we send values to the AI provider to load the "Social_Event_Type" entity and some synonyms for each of the values (the synonyms are not mandatory).

&SDTEntityValues.values.Clear()
&SDTEntitiesValuesValue.value = !"Art"
&SDTEntitiesValuesValue.synonyms.Add(!"Artistic")
&SDTEntityValues.values.Add(&SDTEntitiesValuesValue)

&SDTEntitiesValuesValue = new()
&SDTEntitiesValuesValue.value = !"Culture"
&SDTEntitiesValuesValue.synonyms.Add(!"Cultural")
&SDTEntityValues.values.Add(&SDTEntitiesValuesValue)

&SDTEntitiesValuesValue = new()
&SDTEntitiesValuesValue.value = !"Nature"
&SDTEntitiesValuesValue.synonyms.Add(!"Freh air")
&SDTEntityValues.values.Add(&SDTEntitiesValuesValue)

&InstanceName = !"CitizenServiceSD"
Chatbot.Watson.SendEntitiyValuesProvider(&SDTEntityValues,!"Social_Event_Type",&InstanceName,&messages)
do "ProcessErrors"

After executing this procedure, consider that the AI takes a time to train the information.

See also

Chatbots in GeneXus

Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.