Riley Miller
10/15/2024, 8:04 PMend-of-call
message you can get w/ serverUrls?Vapi
10/15/2024, 8:06 PMend-of-call
message with server URLs, you can indeed implement this functionality. You would typically set up an event listener for the end of the call within your web application and then trigger a report generation process. The specifics of how to do this would depend on the details of your implementation and the capabilities of the VAPI you are using.
If you need more detailed guidance or examples, please let me know what specific aspects you're having trouble with, and I'll do my best to assist you further!Vapi
10/15/2024, 8:06 PMVapi
10/15/2024, 8:07 PMRiley Miller
10/15/2024, 8:08 PMconst toolCallsServerUrl = `${
getConfig().vapiServerUrlOverride ?? getConfig().apiUrl
}/tool-calls`
export const getClientBrandiAssistant = ({
tzId,
}: {
tzId: TimeZoneId
}): CreateAssistantDTO => ({
name: 'Brandi',
model: {
provider: 'openai',
model: 'gpt-4o',
temperature: 0.7,
messages: [
{
role: 'system',
content: getBrandiSystemMessage({ tzId }),
},
],
tools: [
{
type: 'function',
function: {
name: 'createJobRequest',
parameters: {
type: 'object',
properties: {
jobSummary: {
type: 'string',
description: 'A summary of what the customer is calling about',
},
leadSource: {
type: 'string',
description: 'How the customer heard about us',
},
contactLastName: {
type: 'string',
description: 'Last name of the person calling',
},
contactFirstName: {
type: 'string',
description: 'First Name of the person calling',
},
contactPhoneNumber: {
type: 'string',
description:
'The phone number the incoming call is coming from',
},
serviceAddressCity: {
type: 'string',
description: 'The city of the service address',
},
serviceAddressLine1: {
type: 'string',
description: 'The address of the service location',
},
serviceAddressZipCode: {
type: 'string',
description: 'The zip code of the service address',
},
appointmentAvailabilities: {
type: 'array',
items: {
type: 'string',
},
description:
'An array of the different availabilities the person has for an appointment if they want one',
},
serviceAddressStateAbbreviation: {
type: 'string',
description: 'The state of the service address',
},
},
},
description:
'The purpose of this tool is to capture information over the phone and persist it to our CRM as a "job request"',
},
server: {
url: toolCallsServerUrl,
},
async: false,
},
],
},
voice: {
voiceId: '11af83e2-23eb-452f-956e-7fee218ccb5c',
provider: 'cartesia',
fillerInjectionEnabled: false,
},
recordingEnabled: true,
firstMessage:
"Hello, this is Brandi from Popa HVAC. I'm the after-hours AI virtual assistant. How can I help you today?",
voicemailMessage:
"Hey this is Brandi from Popa HVAC. Please call back when you're available.",
endCallMessage: 'Thank you for contacting Popa HVAC. Have a great day!',
transcriber: {
model: 'nova-2',
language: 'en',
provider: 'deepgram',
},
clientMessages: [
'transcript',
'hang',
'function-call',
'speech-update',
'metadata',
'conversation-update',
],
serverMessages: [
'end-of-call-report',
'status-update',
'hang',
'function-call',
],
endCallPhrases: [
'goodbye',
'have a nice day',
'thank you for contacting popa hvac',
],
maxDurationSeconds: 501,
backgroundSound: 'off',
backchannelingEnabled: true,
backgroundDenoisingEnabled: false,
messagePlan: {
idleMessages: [
'Is there anything else I can help you with?',
'Are you still there?',
],
},
})
Which is largely based off the quickstart: https://github.com/VapiAI/client-example-javascript-react/tree/masterShubham Bajaj
10/16/2024, 12:03 PMShubham Bajaj
10/16/2024, 12:03 PMRiley Miller
10/16/2024, 8:15 PMvapi-ai/web
sdk but it never seemed to call the server url with the tool call event and we also never received the end of call event (this one makes sense since we were only trying to set a serverUrl for the tool in the assistant object).
Does this make sense? I added the assistant object we were loading into the web sdk above as a referenceShubham Bajaj
10/18/2024, 12:11 PM