Functions

Execute functions to help your AI generate dynamic answers.

Available in the PREMIUM plan and above.

AIs were limited to answering questions from your static knowledge base.

With function calling, you can have your AI execute third-party APIs or custom logic using Javascript code or HTTP Request to generate a dynamic answer.

Creating a function

First, we create a function form the AI Studio -> Function Call screen

You can even create functions from Set AI and Answer AI blocks in Bot Builder screen.

Each function is made up of 2 things:

Prompt

A brief description that helps the AI understand what this function does and when to invoke this function.

Function handler

This is the API details or Javascript code executed to generate the response to the question asked.

This function would generally consist of

  • API endpoint that is to be invoked

  • Conditions and logic to ask follow-up questions if parameters are missing

Testing the function

On the function, click on 'Save & Run function' to open the test window.

You can customize the LLM model used and see the response generated by it.

Also, to view the exact execution of the function, you can click the 'Show log' to view the entire log.

Here you can view the arguments detected by the function and the output generated by the function.

Last updated

Was this helpful?