2. Variables
Variables in Rounded are, much like in programming, containers that allow you to store and manipulate data. In the context of voice agents, variables primarily serve two functions:
- Provide the agent with contextual data.
- Store data generated during the conversation.
Some variables are configured by default: the caller’s number, the called number, the date and time the call started, and the call ID.
Custom Variables
It’s your turn! You can define four types of variables:
- String: text. The number of characters is not limited, for now.
- Boolean: yes/no.
- Numbers: numeric values.
- Date: specific dates.
Don’t forget to name your variables. This will make life easier for the LLM and help you avoid getting lost when declaring variables.
- Source: a searchable field that indicates where the stored data comes from. Three possible values:
- API Call: originating from an API call.
- CSV: when you initialize your variables at the start of a call from a CSV (see next section).
- Extracted: if the data is extracted from the conversation. Learn more about variables to extract.
Call Context / Call Start
The first building block of any agent is an optional variable initialization block. You use the initialization block if you want to provide your agent with contextual data even before the call starts, whether the agent is answering or initiating a call.
Variables from a CSV
You initialize variables from a CSV only for agents designed to conduct call campaigns.
This involves declaring variables that will be automatically retrieved from the CSV you upload to start a call campaign.
Variables from API Calls
Variables can be initialized from API requests executed before the start of each call. Each API request allows you to initialize several variables simultaneously. To assign values to variables based on API calls, you must fill in the following parameters in the section:
- HTTP Method: Select the appropriate HTTP method based on the action you want the API to perform.
- Endpoint URL: Provide the full URL of the API endpoint that the tool will interact with. Ensure that the URL is correct and accessible.
- Content Types: Specify the format of the data sent and expected from the API. Allowed content types include: JSON and URL parameters.
- Headers: Define the necessary HTTP headers required by the API. Headers may include authentication tokens, content types, and other metadata.
- API Parameters: Configure the parameters required by the API to execute the request. Parameters can be constants, variables, or tool parameters.
- API Response Mapping: To populate variable values, map your API response to the variables. Associate a value with the API response by providing its path from the root of the response using JSONPath.
Once assigned, you can use a variable within {{ }}
to make its value available to the agent.
Ensure that your webhook endpoint is secure and can handle the expected load of incoming events to prevent any data loss or service interruptions.