Injecting current time
By default, the conversation has information about the current date and time in the users’s timezone.
Bolna agents automatically attempt to inject the appropriate timezone during calls. However, for improved accuracy, it is recommended to explicitly pass the timezone, as the automatic detection may not always be precise.
name | description |
---|
timezone | Name of the timezone as per the tz database |
Default variables and context
By default, the following variables and information are always available in the conversation context.
name | description |
---|
agent_id | This is the id of the agent. |
execution_id | This is the unique id of the bolna conversation or the call. |
call_sid | This is the unique id of the phone call belonging to telephony providers like Twilio , Plivo , Vonage , etc. |
from_number | The phone number that initiated the call.
In inbound calls, this is the caller (e.g. customer). In outbound calls, this is your agent’s number. |
to_number | The phone number that received the call.
In inbound calls, this is your agent’s number. In outbound calls, this is the recipient’s number (e.g. customer). |
You may use the above information to pass useful info into your systems or use them in the function calls or prompts.
Example using default variables
For example, adding the below content in the prompt using the above default variables will automatically fill in their values.
This is your agent Sam. Please have a frienly conversation with the customer.
Please note:
The agent has a unique id which is "{agent_id}".
The call's unique id is "{call_sid}".
The customer's phone number is "{to_number}".
The above prompt content computes to and is fed as:
This is your agent Sam. Please have a frienly conversation with the customer.
Please note:
The agent has a unique id which is "4a8135ce-94fc-4a80-9a33-140fe1ed8ff5".
The call's unique id is "PXNEJUFEWUEWHVEWHQFEWJ".
The customer's phone number is "+19876543210".
Custom variables and context
Apart from the default variables, you can write your own variables and pass it into the prompt.
Any content written between {}
in the prompt becomes a variable.
For example, adding the below content in the prompt will dynamically fill in the values.
Example using custom variables
This is your agent Sam speaking.
May I confirm if your name is {customer_name} and you called us on
{last_contacted_on} to enquire about your order item {product_name}.
Use the call's id which is {call_sid} to automatically transfer the call to a human when the user asks.
You can now pass these values while placing the call:
curl --request POST \
--url https://api.bolna.ai/call \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"agent_id": "123e4567-e89b-12d3-a456-426655440000",
"recipient_phone_number": "+10123456789",
"from_phone_number": "+1987654007",
"user_data": {
"customer_name": "Caroline",
"last_contacted_on": "4th August",
"product_name": "Pearl shampoo bar"
}
}'
The above prompt content computes to and is fed as (call_sid
being the default variable gets injected automatically by default):
This is your agent Sam speaking.
May I confirm if your name is Caroline and you called us on
4th August to enquire about your order item Pearl shampoo bar.
Use the call's id which is PDFHNEWFHVUWEHC to automatically transfer the call to a human when the user asks.