Example Prompt
Below is an example of the demo fulfilment prompt using various available tools.
Notice:
- You do not need to outline the data collection steps in the prompt, only in the tool definitions.
- Tools now have a separate field.
- Anything below the
@@@@@@@@@@
in the prompt field MUST be valid JSON and should only be config overrides such asallow_interrupts
- Previous config formats have fall backs and will still be respected
Prompt
You are a helpful voice assistant customer support agent named Navi. You work for Talkative Health. Make sure that all output can be easily read out using a text to speech layer so don't use abbreviated formats for dates and times. When gathering information, ask for one piece of information at a time. # Appointments You can offer transferring them to a human, which involves a wait time our using the voice assistant service. If they choose to use the voice assistant, you will find available slots and then book a preferred slot. When offering slots don't offer more than 3 options. Before booking the appointment make sure you check the details. # Parking Customers can request on-site parking. You must check that the car has a valid MOT Status before allowing it. # Emergency If a customer is frustrated, say you will transfer them immediately. @@@@@@@@@@ { "voice_ai_config": { "allow_interrupts": true } }
Tools
[ { "id": 1, "label": "Get Available Slots", "description": "Get available appointment slots within a date range", "type": "CAL_COM_GET_SLOTS", "parameters": [ { "name": "startDate", "type": "string", "description": "Start date in YYYY-MM-DD format" }, { "name": "serviceType", "type": "string", "description": "Type of service requested (e.g. 'consultation', 'check-up')" } ], "config": { "token": "cal_live_TOKEN", "eventTypeId": 1234 } }, { "id": 2, "label": "Book Appointment", "description": "Book an appointment using a specific slot", "type": "CAL_COM_BOOKING", "parameters": [ { "name": "start", "type": "string", "description": "The start time of the chosen slot" }, { "name": "fullName", "type": "string", "description": "User's full name" } ], "config": { "token": "cal_live_TOKEN", "eventTypeId": 1234, "timeZone": "Europe/London", "email": "orders@gettalkative.com", "phoneNumber": "+447912345678", "smsTemplate": "{{meetTitle}} at {{meetDateTime}}. Click here to join: {{meetUrl}}", "smsDateLanguage": "en-US" } }, { "id": 3, "label": "Check MOT Status", "description": "Check that the car with given registration has a valid MOT", "type": "HTTP_REQUEST", "parameters": [ { "name": "registrationNumber", "type": "string", "description": "The Car's Registration Number" } ], "config": { "endpoint": { "method": "POST", "url": "<https://driver-vehicle-licensing.api.gov.uk/vehicle-enquiry/v1/vehicles>" }, "headers": [ { "name": "x-api-key", "value": "abcdefghjklmn1234567890" } ], "body": "{\"registrationNumber\": \"{{registrationNumber}}\"}" } }, { "id": 4, "label": "Transfer", "description": "Use this tool to transfer the user to a human agent or department", "type": "TRANSFER", "parameters": [], "config": { "destinations": [ { "type": "DIAL", "destination": "+441633302063", "description": "Billing Department and Jared Dunn" }, { "type": "DIAL", "destination": "+441633302069", "description": "Richard Hendricks" } ] } }, { "id": 5, "label": "Hang Up", "description": "Use this tool to hang up the call when the user asks about refunds", "type": "HANG_UP", "parameters": [] } ]
General Config voice_ai_config
The first section of the JSON you can override any of the settings that are currently in the database or missing from the current database, in this case allow_interrupts. Any properties in here are optional. If allow_interrupts is missed VAI will default to false (no interrupts).
{ "voice_ai_config": { "allow_interrupts": true } }
Tools Config Field
There are four basic tool included at the moment, HANG_UP, TRANSFER, KNOWLEDGE_BASE and HTTP_REQUEST.
If the transfer tool is not configured one will be automatically added for backwards compatibility. The Http Request tool is a generic request tool that can make HTTP requests to fetch data based on provided parameters.
Two additional tools have been added for demo purposes,CAL_COM_GET_SLOTS and CAL_COM_BOOKING.
General Information
All tools have the following required properties.
id
- This can be set to any integer and is largely for using as a resource identifier within Engage. Just make sure that it is unique in your config. So in the above example I have1, 2 and 3.
label
- Primarily an UI element and currently not utilised or read by the LLMdescription
- Here you can explain to the LLM what the tool is, what it does and/or when to use it.type
- One of the types that are supported. (`HANG_UP, TRANSFER, KNOWLEDGE_BASE or HTTP_REQUEST`)parameters
- The pieces of data that the tool requires in order to execute.name
- a ‘camelCase’ or ‘snake_case’ variable name. This will then be used as a reference for templating or is prescribed by custom tools.type
- the parameter type. Options arestring
,number
,boolean
,null/empty, object
,array
description
- A clear explanation of the parameter's purpose and expected format. You can include examples of the expected formats.
config
- Bespoke to each individual tool.
Templating
Some properties will allow templating to insert configuration options, variables or call details into strings. For example, if you get the LLM to gather a parameter called songTitle
you can add it into a URL for the HTTP_REQUEST
tool using an template that might look like this: http://spotify.com/{{songTitle}}/artist
. Care should be taken the working with JSON within JSON and quotation marks should be escaped appropriately. For example the JSON body for the HTTP_REQUEST
tool might look like this: "url": "{\"songTitle\": \"{{songTitle}}\"}"
.
TRANSFER
Automatically included, does not need added to the JSON unless customisation is required.
The custom configuration for this tool (*Required):
destinations
an array of possible destinationstype
* - The type of transfer, this can beDIAL
for a regular call and number. Alternatively, if the call is coming from SIP we can do a refer transfer usingREFER
orMITEL_REFER
destination
* - The transfer destination, if the type is a dial this should be a full ‘e.164’ phone number. ForREFER
type this should be a full SIP address. For MITEL_REFER this can be an extension number which will be passed to MiCC as part of the request for transfer.description
* - The description for this option. This will be used by the LLM as part of choosing where to transfer.
Default:
{ "id": 1, "label": "Transfer", "description": "Use this tool to transfer the user to a human agent or department", "type": "TRANSFER", "parameters": [], "config": {} }
Complex:
{ "id": 1, "label": "Transfer", "description": "Use this tool to transfer the user to a human agent or department", "type": "TRANSFER", "parameters": [], "config": { "destinations": [ { "type": "DIAL", "destination": "+441633302063", "description": "Billing Department and Jared Dunn" }, { "type": "DIAL", "destination": "+441633302069", "description": "Richard Hendricks" }, { "type": "MITEL_REFER", "destination": "1234", "description": "Russ Hanneman" } ] } }
HANG_UP
This tool is used to tell the AI when to hang up the call without transfer.
{ "id": 2, "label": "Hang Up", "description": "Use this tool to hang up the call when the user asks about refunds", "type": "HANG_UP", "parameters": [] }
KNOWLEDGE_BASE
This tool is used to look up some information in an existing Knowledge Base in Engage.
The custom configuration for this tool (*Required):
knowledgeBaseId
* - The ID of the Knowledge Base that you want to use for the look up. This can be found in the address bar when viewing an Knowledge Base in Engage.contextSizeLimit
- Default: 3500 - The upper character limit for the context that the LLM will be given for the given search term.
{ "id": 3, "label": "Knowledge Base", "description": "Use this tool to get additional context on Silicon Valley", "type": "KNOWLEDGE_BASE", "parameters": [ { "name": "searchText", "type": "string", "description": "Text to search the knowledge base for embeddings" } ], "config": { "knowledgeBaseId": 1 } }
HTTP_REQUEST
This tool is used for basic HTTP requests.
The custom configuration for this tool (*Required):
endpoint
*method
* - The HTTP method to be used. For exampleGET
orPOST
url
* - The request destination endpoint. Can include templating
headers
- An array of headers, each described with aname
and avalue
. Both can contain templating.body
- The body of the request. Can include templating
CAL_COM_GET_SLOTS
The custom configuration for this tool (*Required):
token
* - Can be generated in the API Keys Page, once you've registered an account.eventTypeId
* - Can be found in the URL after clicking an existing event type on the Event Types Page. For examplehttps://app.cal.com/event-types/2086911?tabName=setup
means the id is2086911
.timeZone
- The time zone that you’d like to use for the slots being read out
CAL_COM_BOOKING
The custom configuration for this tool (*Required):
token
* - Can be generated in the API Keys Page, once you've registered an account.eventTypeId
* - Can be found in the URL after clicking an existing event type on the Event Types Page. For examplehttps://app.cal.com/event-types/2086911?tabName=setup
means the id is2086911
.timeZone
- Default:Europe/London
- The time zone that will be used when communicating with the customer via email and SMSemail
- Where the customer's confirmation email will be sent. This is not required by cal.com, but it allows for nice confirmation emails to be sent from the Voice AI as part of a demo.phoneNumber
- Where the customer's SMS confirmation will go. The tool will attempt the use the Caller ID if valid. Alternatively, it will then then try to use a gathered phone number as part of the parameters, if configured. Lastly, it will use this config option as a last resort.smsConfirmation
- Default:true
- Choose whether we should attempt to send a confirmation SMSsmsTemplate
- Default:{{meetTitle}} scheduled for {{meetDateTime}}. Join at {{meetUrl}}- The template for the SMS confirmation. Can include templating, but only usingmeetTitle
,meetDateTime
,meetUrl
and any parameter that is gathered by the tool.smsDateLanguage
- Default:en-GB
- This is the locale for themeetDateTime
. Possible options can be found here under ‘Parameter Values - locales`.
Adding a aphoneNumber
as a parameter can be configured as shown below. In this case the gathered phone number will be used instead of the hard coded one in config
.
{ "id": 2, "label": "Book Appointment", "description": "Book an appointment using a specific slot", "type": "CAL_COM_BOOKING", "parameters": [ { "name": "start", "type": "string", "description": "The start time of the chosen slot" }, { "name": "fullName", "type": "string", "description": "User's full name" }, { "name": "phoneNumber", "type": "string", "description": "User's phone number, including country code" } ], "config": { "token": "cal_live_TOKEN", "eventTypeId": 1234, "email": "orders@gettalkative.com", "phoneNumber": "+447912345678" } }
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article