Swiftsell Help Center
  • 😀Welcome to Swiftsell
    • Swiftsell Basics
  • 🏁GETTING STARTED
    • Building a Chatbot
    • Testing a Chatbot
    • Installation
      • Installation on Website
        • Installation using HTML
        • Installation using Google Tag Manager
      • Installing on SquareSpace
      • Installation on WhatsApp
      • Installation on Facebook
    • Deploying a Chatbot
    • Utility Tools
  • ⚒️BOT BUILDER
    • Action Block
      • Trigger
      • Send Message
      • Collect Input
      • Buttons
      • Reply Buttons
      • Carousel
      • Answer AI
      • Set AI
      • Send an Email
      • List
      • Human Handover
      • Dynamic Data
      • Javascript
      • Form
      • Flow
      • Options
      • Calendar
      • Slider
      • Image Carousel
      • WhatsApp Flow
    • Branch
    • File Upload
  • ✨AI STUDIO
    • Building a GPT chatbot
    • Knowledge base
    • Custom Answers
    • Function call
    • Prompts
    • Tokens
    • Setting up retrain
  • 🔗Integrations
    • Overview
    • Events
    • Service Call
    • Google Sheets
    • Google Calendar
    • Calendly
  • 💬WHATSAPP BUSINESS API
    • Overview
    • WhatsApp Business API from Meta
  • 💬Live Chat
    • Overview
    • Live Chat Screen
    • Live Chat Settings
  • 📣OUTBOUND BOTS
    • Overview
    • Building One Off Campaign
    • Building Ongoing Campaign
    • Creating a WhatsApp Template
Powered by GitBook
On this page
  • Creating a function
  • Testing the function
  1. AI STUDIO

Function call

Execute functions to help your AI generate dynamic answers.

Last updated 10 months ago

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

With function calling, you can have your AI execute a Javascript function that invokes third-party APIs to generate a dynamic answer.

Creating a function

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

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 the '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.

✨