Function call
Execute functions to help your AI generate dynamic answers.
Available in the ULTIMATE plan and above.
AIs were limited to answering questions from your static knowledge base.
With function calling, you can have your AI execute Javascript function which invoke third-party APIs to generate a dynamic answer.
Creating a function
First, we create a function form the AI Studio -> Function Call screen
![](https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252F1Gu7alWxcs51sDA3TIWd%252FCleanShot%25202024-07-01%2520at%252019.57.28.png%3Falt%3Dmedia%26token%3Da2d11ff9-fee1-4bdc-b3c5-9900d5a3e93e&width=768&dpr=4&quality=100&sign=c6092a1e&sv=1)
Each function is made up of 3 things:
Prompt
A brief description that helps the AI understand what this function does.
Parameters
The list of parameters that are required for this function to be executed. The parameters need to be provided in the form of a JSON array.
Function handler
This is the 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.
![](https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252FTyKXvjUcVpHLLv7FAVBL%252FCleanShot%25202024-07-01%2520at%252020.10.01.png%3Falt%3Dmedia%26token%3D0f29c3bd-48a3-4844-8342-c260d439b493&width=768&dpr=4&quality=100&sign=a3a9d4a0&sv=1)
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.
![](https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252FQOwtJ3Py7JoNiIvVTLOE%252FCleanShot%25202024-07-01%2520at%252020.10.51.png%3Falt%3Dmedia%26token%3D6189f9a9-d5ff-44f6-a18f-accbd8ce6dee&width=768&dpr=4&quality=100&sign=3078548&sv=1)
Last updated