AI Chatbot Tools allow chatbot to integrate to other services. Use them to collect leads, fetch data or execute actions for the visitor.
AI Chatbot Tools work as a connection between AI Chatbot and Workflow builder by allowing chatbot to call workflows and to get responses from them. Meanwhile, Workflow Builder allows you to implement custom logic and to integrate to third party services with easy to use coding platform, enabling infinite possibilities for tools.
The AI Chatbot Tools are composed of three main steps:
1.Configuration: Users need to configure the tool by providing instructions to the AI on how to use the tool and by defining the parameter values that are gathered from the visitor.
2.Workflow Creation: Users must create a workflow that processes the collected information and performs specific actions. This workflow acts as the backbone of the tool, utilizing the gathered data to interact with external services, execute business logic, or perform calculations. The workflow can include steps like calling APIs to integrate with third-party platforms.
3.Response Integration: The workflow then returns text back to the AI chatbot, allowing it to respond appropriately based on the processed information. This final step ensures that the chatbot can provide meaningful and contextually relevant answers to the user, leveraging the outcomes from the workflow to enhance the overall conversational experience.
These components work together to empower the chatbot with advanced capabilities, enabling it to handle a wide range of tasks efficiently and effectively.
Configuration
The configuration process for AI Chatbot Tools involves several key steps, all of which are facilitated through a user-friendly interface. This section will guide you through the essential elements of setting up and configuring your tools.
1. Tool Information:
- Tool Name: You can provide a name for the tool by pressing the name text in the upper left corner. This name is visible for humans.
- Tool Description: This description helps users understand the purpose and functionality of the tool. This description is also visible for humans only.
- Instructions for the AI: Define specific instructions for the AI on how to use the tool. These instructions should include details what the tool does, when to use it, and what to expect as a result.
- Name for AI: This is the name of the tool that is given for the AI. It has to be a valid function name: It can't start with a number and can't contain spaces. The name should also be unique within the organization. The name should also describe what the tool does. To make this easier, we automatically generate the name based on the fields mentioned above whenever there has been changes to those fields when you save. You can disable this by selecting to override the name and you can edit the name at that point.
2. Parameter Definition:
You can define any number of parameters for your tool. These parameters are sent to the workflow with values selected by AI. Remember to name and describe your parameters so that AI understands how to collect the values correctly.
- There are multiple different types of parameter values you can collect.
- String: Strings are a list of characters, such as freeform text, codes like order numbers, or one option from multiple choices.
- Number: Number type is specifically a valid number you can find from a number line, such as 1, 3.14 or -5.
- Boolean: a boolean parameter can get values of true or false.
- JSON: Unlike other types that hold a single value, JSON can hold multiple values in a meaningful structure, such as {"toppings": ["pepperoni", "jalapeno", "blue cheese"], "gluten-free": true}. Remember to describe the structure you want AI to follow in the instructions for ai.
- Email: This type is a string, with special validation that ensures the values look like valid email addresses.
- Phone: This type is a string, with special validation that ensures the values look like international e.164 formatted phone numbers.
- URL: This type is a string, with special validation that ensures the values look like valid webpage addresses.
- Each parameter requires a name that is unique within the tool. The name shouldn't start with a number and shouldn't contain spaces. The name should be descriptive of what kind of data it should hold. Note that these names are also used in the workflow builder to access the values.
- Each parameter can be given instructions for AI. Use these to describe what kind of values should be given for this parameter, possibly with examples. You can also give rules that should be followed.
- You can define validations that the values need to satisfy:
- Required: When this is active, a value must be given for this parameter. When inactive, the value can be left empty by the AI. Parameters that haven't been given values exist and have a value of null when passed on to the workflow builder. The AI sees whether a parameter is marked as required or not.
- Regex: Regular expressions define patterns that a string must follow to be accepted. One can for example define here what their company's customer ids should look like. For some common patterns, you can find ready-made regex patterns online. For simple cases, you can also try asking for a regex pattern from an LLM such as ChatGPT or Gemini. Remember to test that your pattern works as you expect it to. Regex validation can be used with string parameters. AI will see the pattern given for the regex, so you don't need to rewrite it to instructions.
- Limit accepted values: You can define a list of allowed values for the parameter. This is useful if you want the AI to select one option from multiple choices. For example, if AI needs to select a dish from a restaurant menu, you can list the names of the dishes here, so that the AI doesn't select a dish that doesn't exist. This validation can be used with strings and numbers. AI will see the list of accepted values, so you don't need to rewrite it into the instructions.
- Limit to a specific range: With number-typed parameters, you can define a list of ranges so that the selected number value must be within one of the ranges. Each range is defined by a min value and a max value. The ranges are inclusive, so the min and max values are also valid values. For example, if you are asking for an age, you can limit the values to be from 0 to 120. AI will see a single range, with the lowest min and highest max of all the ranges. If you need it to know the ranges more specifically, write about them in the instructions for AI.
- Chatlog validation: Chatlog validation checks that the value given by the AI is contained in the chat messages. There are two types of chatlog validation. One that requires that the value is contained in either visitor or agent message and another that requires that the value is contained in a visitor message. This validation exists to prevent the AI from coming up with fake values that are not given by the visitor. Email, phone and URL typed parameters have the visitor or agent message validation always on, while for JSON it is always off. AI will not see if this validation is active or not, so you might need to mention it separately in the instructions for AI.
3. Automations:
- Before Answering Run: Choose which workflow is run before bot writes its answer. A workflow needs to be live in order for it to be listed in the options. As this workflow is run before the bot's answer, it's possible to return information to the bot that is then used when forming the answer message.
- Expect Response: This option indicates whether the AI should wait for a response from the workflow. If your tool doesn't need to return anything, AI gets to answer right after triggering the workflow, speeding things up. Setting a response timeout ensures the AI doesn’t wait indefinitely. For example, if a workflow gets an error before being able to return a response, the AI will just continue the conversation after the timeout duration.
- After Answering Run: Choose which workflow is run after the bot has written its answer. There's no possibility to return a response in this workflow. Instead, this workflow can be used to do things that need to be done after the answer, such as sending an interaction or triggering a transfer to agents.
4. Services:
- Use this tool with Copilot: All tools are always available to a bot that is discussing with visitors directly. With this setting, you can also enable the tool to be used with copilot, which suggests replies to human agents. This can be a good idea for tools that fetch information for an answer, while bad for tools that do actions on behalf of the visitor.
Utilizing tools in bots
Once tools have been created, they need to be linked to the correct answers.
Each QnA knowledge base answer and the fallback answer in the bot's settings has two types: Manual answer and tool answer. While manual answers allow you to specify what happens when that answer is given very strictly by allowing you to choose what kind of messages are sent and what behavior is done after the answer, the strictness doesn't work well with tools, where the AI might need to be able to have a multi-message conversation with the visitor in order to call a tool. Tool answers allow the bot to have more freedom over messages and behavior.
With tool answers, you can write instructions for AI on how to answer to the visitor when this answer is given. You can also then assign up to 5 tools to that answer. When this tool answer is selected by a bot, it sees the tools and can choose to use them freely. With some tools, the bot might need to ask for values for the parameters. For this, a tool answer might stay active over multiple visitor messages, if it is detected that the visitor is answering questions given by the bot.
Usage with workflow builder
At the heart of tools lie the workflows that are initiated by the tool calls. These workflows have the ability to connect to third-party services and execute your customized logic, empowering your bot with advanced capabilities.
When tools call your workflows, they provide as inputs three sets of information: arguments, response_url and context:
- arguments: Arguments is a JSON object that contains as keys the names of your parameters and as values the values for the parameters as chosen by the AI.
- response_url: This input has as a value a URL where you can post your response to the AI.
- context: This input contains information about the situation where this tool was called. It has the visitor message that triggered the call, the confidence level of the answer, the location of the tool call (before answer or after answer), a list of ids from AI chatbot and a list of live chat ids that can be used to make API calls to giosg systems.
To get access to these inputs, create local variables with the exact same name for your workflow. Then if you have, for example, a parameter called firstname, you can access its value with arguments[firstname] expression, where arguments is a yellow box and firstname is a gray box.
When you're ready to return a response to the bot, create an HTTP post request to the response_url, with the request body being a string that contains text that helps the bot answer the visitor's message. The request doesn't require authentication. Try to send the response as soon as it's known, so that the bot gets to continue the conversation as soon as possible. Remember that you can continue processing in the workflow after sending the response. Only one response can be sent per tool call.