How should i ask vapi to trigger a tool function a...
# support
s
How should i ask vapi to trigger a tool function after the call has been disconnected
v
You can continue this conversation by mentioning me in the message.
@Saurav To trigger a tool function after the call has been disconnected, you can set up a post-call trigger within your application logic. This trigger would execute the desired function once the call ends. If you're looking to execute a specific function from the VAPI, you would typically do this by sending a request to the VAPI server with the necessary parameters for the function you want to trigger. If you have a specific function in mind that you'd like to execute after the call disconnects, please let me know the function name and any required parameters, and I can assist you further with that.
s
@User Yes i have a function called book appointment which i want to trigger once the call disconnects. The parameters are 'Name', 'Email', 'Phone', 'Description' and 'StartTime'. I also wants the call summary inside this , is it possible
@Vapi Yes i have a function called book appointment which i want to trigger once the call disconnects. The parameters are 'Name', 'Email', 'Phone', 'Description' and 'StartTime'. I also wants the call summary inside this , is it possible
v
@Saurav Certainly! To book an appointment after the call disconnects, you would need to set up a process that listens for the "end-of-call-report" message. Once the call ends and you receive this message, you can extract the call summary from the "call" object within the message and use it as part of the 'Description' parameter for the 'book appointment' function. However, to proceed with booking the appointment, I would need the 'Name', 'Email', 'Phone', and 'StartTime' details. If you have these details ready, please provide them so I can help you trigger the 'book appointment' function with the call summary included in the 'Description'. If these details are to be collected during the call, you would need to ensure that your application logic captures and stores them so they can be used in the function call after the call ends. Can you confirm if you have these details, or if you need assistance with capturing them during the call?
s
@Vapi it will be collected during the call
v
@Saurav Great! Since the details will be collected during the call, you'll need to ensure that your application logic is set up to capture the 'Name', 'Email', 'Phone', and 'StartTime' from the caller during the conversation. Once the call ends and you receive the "end-of-call-report" message, you can then combine these details with the call summary to form the 'Description' parameter. Here's a high-level overview of the steps you would take: 1. Collect 'Name', 'Email', 'Phone', and 'StartTime' during the call. 2. Listen for the "end-of-call-report" message upon call disconnection. 3. Extract the call summary from the "call" object in the "end-of-call-report" message. 4. Combine the call summary with any additional information to form the 'Description'. 5. Trigger the 'book appointment' function with all the collected parameters. If you have the logic in place to capture the necessary details during the call and can provide them here, I can assist you with the next steps to trigger the 'book appointment' function. If you need help with setting up the logic to capture the details during the call, please let me know, and I can guide you through that process as well.
s
@Vapi What is the logic i need to capture the details during the call and houw would i do it
@Vapi What is the logic i need to capture the details during the call and how would i do it
@Vapi i tried to add this in the Vapi task prompt , but its not working Collect 'Name', 'Email', 'Phone', and 'StartTime' during the call. Listen for the "end-of-call-report" message upon call disconnection. Extract the call summary from the "call" object in the "end-of-call-report" message. Combine the call summary with any additional information to form the 'Description'. Trigger the 'book appointment' function with all the collected parameters.
@Vapi
v
@Saurav I apologize for any confusion. To capture details during the call and trigger a function after the call disconnects, you would typically need to implement the following logic within your voice application: 1. Capture Details During the Call: - Use voice prompts to ask the caller for their 'Name', 'Email', 'Phone', and 'StartTime'. - Implement speech recognition or DTMF (Dual-Tone Multi-Frequency) inputs to capture the caller's responses. - Store these responses in variables or a database for later use. 2. End-of-Call Logic: - Set up an event listener for call disconnection. - When the call ends, the event listener should trigger the logic to handle the "end-of-call-report". 3. Extract Call Summary: - Retrieve the call summary from the "end-of-call-report" message. 4. Combine Information for 'Description': - Concatenate the call summary with any additional information you wish to include in the 'Description' parameter. 5. Trigger 'Book Appointment' Function: - Use the captured details and the combined 'Description' to call the 'book appointment' function. If you're having trouble implementing this logic, it could be due to various reasons such as incorrect syntax, improper event handling, or issues with data storage and retrieval. To assist you further, I would need to know more about the specific issues you're encountering and the platform or programming language you're using to implement this logic. Please provide additional details about the errors or issues you're facing, and I'll do my best to help you resolve them. If you're using a specific API or SDK for VAPI, please also mention that, as it will help me give you more precise guidance.
s
@Vapi How would i setup the event handling in vapi prompt
@Vapi How would i setup the event handling in vapi prompt
@Vapi
s
after the call vapi cannot trigger the function/tool.
s
There should be a way where it can trigger an event and that event can trigger the tool ?
s
it can be done right before ending the call using tool calling.
s
Thanks.There is a URL section you can add inside the Advanced Tab to perform various things during and after the call. It helped me achieve my flow.
12 Views