A Function is a predefined or dynamic task that the AI Agent can invoke during a conversation. For example, when a customer asks for weather information, the AI Agent can call a weather service API using a Function to retrieve the latest forecast. Functions allow the AI Agent to go beyond its prebuilt knowledge pool and access real-time data or execute specific actions based on the user's needs.
A function call involves the following procedures:
- Function Setup: You need to define the Function for the AI Agent to use by providing the core parameters such as function name and API endpoint.
- Function trigger: During a conversation, when the AI Agent detects a task from the user's query, for example, looking up flight information or executing a calculation, it triggers the corresponding Function.
- Function execution: The AI Agent executes the function, whether it's fetching data from an external service or performing a complex algorithm. If the function requires the user’s input, for example, the user’s location, the AI Agent will collect the data from the user.
- Result return: The AI Agent receives the returned output and generates a response to the user. For instance, the AI Agent can present the weather data retrieved from an API or display results from a database query.
Steps by Step Instructions
To set up the Function for the AI Agent, follow these steps:
- Log in to your Comm100 Control Panel. 
- From the left navigation menu, go to AI & Automation> AI Agent > Functions. If you have multiple AI Agents, make sure to choose the correct one from the drop-down list.
- Click New Function.
- On the New Function screen, input the Function name and description. Provide a meaningful name and description to help the AI Agent understand what the function is used for.
- Turn on or off the Enable Global Function Autocall option. This option is enabled by default.
- When enabled, the AI Agent can call this function no matter if the function has been added to a Topic answer.
- When disabled, the AI Agent can call this function ONLY if the function has been added to a Topic answer.
- (Optional) Provide the Input parameters for the Function to process.Note: If an input parameter is set to required, the AI Agent will try to find the input value from the conversation. If the AI Agent cannot find it, it will ask the user to provide the value.
- Complete the API endpoint settings.
- If the API endpoint requires authentication, turn on the Authorization Required toggle, and choose the credential from the drop-down list.
- Choose the GET or POST method, and input the endpoint URL.
- Provide the HTTP Header and HTTP Body.
- (Optional) Add the output fields. Typically, the AI Agent can interpret the meaning of each JSON field returned by the API endpoint. If the field name cannot convey the field's intended meaning, you can define the output field and provide a description to help the AI Agent understand. You can also store the field value as a variable for later use.
- Click Save.