blocks
# support
a
Question about initiating a function on an incoming call immediately? I have an assistant with the ServerURL prefilled with a webhook in Make. I have the Server Messages set with 'tool-calls' and 'function-call'. It doesn't fire immediately on the call, but will trigger shortly after depending on the conversation. The webhook works and returns the info I need but I just cant find a way to have it do it right off the bat. Thank you in advance!
v
@andrew It sounds like you want to trigger a function call as soon as a call is received, without any delay. To achieve this, you should ensure that the webhook is set up to be triggered by the 'incoming-call' event if that's supported by your system. This way, as soon as the call is connected, the webhook can be executed. If the 'incoming-call' event is not available, you might need to adjust the configuration of your assistant to minimize the delay before the function is called. This could involve setting up an initial prompt that triggers the function call as soon as the assistant starts. If you're looking to start a call with a specific assistant ID and want to ensure the webhook is triggered immediately, you can use the .start() function with the assistant ID. If you provide me with the assistant ID, I can initiate the call for you. If you need to adjust the assistant configuration, you might need to do that through the Dashboard or the API where you initially set up the assistant. If you need further assistance with the configuration or if there's a specific function you want to call, please provide more details so I can assist you better.
You can continue this conversation by mentioning me in the message.
a
Thanks, my assistant is configured through the dashboard. I don't see an 'incoming-call' event anywhere. How can I set up a prompt that triggers it as soon as the assistant starts?
the specific tool is called 'getTheCustomerDetails'
@Vapi ^
v
@andrew To set up a prompt that triggers the 'getTheCustomerDetails' function as soon as the assistant starts, you will need to configure the initial interaction in your assistant's dashboard to call this function. Here's a general approach to achieve this: 1. **Initial Greeting**: Configure the initial greeting or welcome message of your assistant to include a trigger for the 'getTheCustomerDetails' function. This can often be done by setting up an intent that is recognized immediately when the call starts. 2. **Webhook Configuration**: Ensure that your webhook is configured to listen for the initial interaction. If your assistant platform allows for custom events, you might be able to create an event that is fired as soon as the call is connected. 3. **Automated Trigger**: If your assistant supports automated actions, you can set up an action to automatically call the 'getTheCustomerDetails' function as part of the initial workflow. 4. **Test the Configuration**: After setting up the initial prompt, test the call flow to ensure that the 'getTheCustomerDetails' function is being called immediately as the call starts. If you're not sure how to configure these settings through the dashboard, you may need to consult the documentation for your specific assistant platform or reach out to their support team for detailed instructions. Since I don't have the capability to directly modify your assistant's dashboard settings, if you need further assistance with the configuration, please ask support for more info on this.
a
@Vapi can you provide me with an example of number 1? Configuring the initial greeting to include a trigger?
@Vapi can you provide an example of configuring the initial greeting to include a function trigger?
s
@andrew what you can do is set the first message mode to
assistant-speaks-first-with-model-generated-message
and then generate the first message content and do tool calling together using prompting.
example
- trigger the toolName tool and Say: Do let me know how it goes. FYI: If this direct example doesn't works, then do try out other tweaks. The gist to generate first message and do tool calling in the mode first instruction.
a
Thanks Shubham, I ended up following some other advice to create the transient assistant after the 'assistant-request'. I was able to get that to work by grabbing the CRM information before answering the call, which is what I was really hoping for. Thanks for the input though!
3 Views