Functions
Last updated
Last updated
The Functions page allows you to configure one or more function for your AI training. Functions are a way for your AI to tap into realtime data, extracted directly from the bot flow.
While Resources are the optimal way of training your AI with semi-static data, functions are the perfect tool to let your AI obtain realtime data that would otherwise be difficult to keep up to date.
Functions are automatically triggered by your model whenever it feels it can fit a specific information requirement.
Let's say, as a potential example, that we want our AI to be able to provide information about any order related to the current user. In a standard flow setup, assuming for our example that we pick the orders from the Xenioo Database, we could create something like this:
The interaction above can be used exactly as it is by your AI by just creating a function where you target it and by explaining that it should be used when the user wants to retrieve information on a specific order.
Since we want the user to tell us the unique tracking number for the order to be tracked, we also instruct the AI to ensure that that specific parameter is required, before calling us.
Just by doing these simple steps, we've made our model capable of engagin in a conversational exchange that can involve realtime data, pulled directly from our no-code flow.
Every function is defined by these fields that will help your AI provider understand when to use it and what to activate when required.
This is the name of the function and will be used to uniquely identify it. It can be any name you prefer as long as it doesn't contain spaces and its not identical to any other function name already defined.
These fields define the Behaviour and Interaction that will be invoked by the AI model when it detects that the function is needed.
Once the specified interaction is executed, the AI will use any text returned to form the final message returned to the user. Please note that depending on the chosen model, the AI might decide to alter the content of the message while maintaining the original meaning.
This text explains the function's purpose. Make sure to explain clearly when the function should be used since this is how your model will decide to engage or not Xenioo on this particular topic.
A disabled function will not be included in training. Use this flag to temporarily remove a function from the training without deleting it completely.
The parameter is a specific input that the function requires to perform its task. All parameters will be automatically passed to your flow as variables exactly like they would in a normal conversation.
This is the name of the parameter. This exact text will be passed to your flow as variable.
This explains the purpose of the parameter, what it represents and how it should be used. The Information supplied here might be used by the model if the user ask for further information.
If the parameter is related to a code that can be found on a package, as an example, feel free to add in this field. If the user asks where could he find the code you're asking for, the AI will suggest to look on the package.
This specifies the kind of data the parameter is expected to contain. You can use this field to have the AI do a general test on the content of the user reply and ensure consistency. All parameters will be sent to your flow as strings like any other variable.
Standard values are string, number or boolean.
This flag sets the parameter as required or not. Your flow will not be invoked by the AI until all required parameters are collected. Your model might engage in multiple conversation steps to collect all required parameters before actually calling your flow execution.
In the example below, the order_id parameter is set as mandatory, but the user didn't provide it on the first round: