Skip to content

v13.5.0

Compare
Choose a tag to compare
@boehlerlukas boehlerlukas released this 06 Mar 15:52
· 99 commits to master since this release

Added AI tools to register local AI functions, allowing you to create deep integrations between Kai and your app.

Gleap.setAiTools([{
    name: 'send-money',
    description: 'Send money to a given contact.',
    response: 'The transfer got initiated but not completed yet. The user must confirm the transfer in the banking app.',
    parameters: [{
        name: 'amount',
        description: 'The amount of money to send. Must be positive and provided by the user.',
        type: 'number',
        required: true
    }, {
        name: 'contact',
        description: 'The contact to send money to.',
        type: 'string',
        enum: ["Alice", "Bob"],
        required: true
    }]
}]);

Gleap.on("tool-execution", (tool) => {
    if (tool.name === "send-money") {
        const amount = tool.params.amount;
        const contact = tool.params.contact;

        // Initiate the transfer here.
    }
});