Can Vapi use Tools on its own?
# support
f
Hi guys, is it possible to say Vapi that he should run the tool "Booking" whenever the client agreed on a date? I tried it with: "#Run the tool 'Booking' whenever you and the client agree on a date. (put this line before the #example step) I know I can put the function call in the example script, but my example scripts covers a lot of objection handling and I would like to make sure that the appointment gets booked even if the conversation goes through 10 objections. Thanks for your help!
v
@fisch3r Hello! Absolutely, you can instruct Vapi to run the "Booking" tool when you and the client agree on a date. To ensure that the appointment gets booked regardless of how the conversation flows, you can set up a trigger within your conversation logic that listens for a positive confirmation from the client about the date. Once you detect that the client has agreed to a date, you can then programmatically call the "Booking" function. If you have a specific function name or endpoint set up for this purpose, please provide it, and I can guide you on how to integrate it into your conversation flow. If you need the exact code or method to implement this, please let me know the programming language or platform you're using, and I'll do my best to assist you further!
You can continue this conversation by mentioning me in the message.
f
@Vapi where can I set up a trigger?
v
@fisch3r To set up a trigger within VAPI, you would typically handle this in the code of your voice application. The exact implementation can vary based on the platform or programming language you are using, but the general idea is to listen for a specific intent or keyword that indicates the client has agreed to a date. Here's a simplified example of what the logic might look like in pseudocode:
Copy code
pseudocode
on user_message_received(message):
    if message_contains_agreement(message):
        date = extract_date(message)
        if date_is_valid(date):
            run_booking_tool(date)
        else:
            ask_for_valid_date()
    else:
        handle_other_conversation_flows(message)

function message_contains_agreement(message):
    // Implement logic to determine if the message indicates agreement on a date

function extract_date(message):
    // Implement logic to extract the date from the message

function date_is_valid(date):
    // Implement logic to validate the extracted date

function run_booking_tool(date):
    // Call the "Booking" tool with the agreed date
If you're using a specific voice application development platform, it may have built-in support for defining triggers or intents. You would define an intent for when a user agrees to a date, and then in the handler for that intent, you would call the "Booking" tool. If you need more detailed guidance, please provide information about the platform or tools you are using, and I can give you a more specific answer. If there's a function within VAPI that you need to call, please provide its name or details, and I can assist you with that as well.
f
@Vapi I use the Vapi Dashboard, no external plattform or code at the moment
v
@fisch3r Great, if you're using the Vapi Dashboard, you'll be working with the tools and features provided within the Vapi platform to set up your triggers and call the "Booking" tool. Here's a general approach to setting up a trigger within the Vapi Dashboard: 1. **Define Intents**: Create an intent that captures the user's agreement to a date. This intent should be trained with various phrases that users might say when they agree to a date. 2. **Create Entities**: If you haven't already, define an entity for the date that can be extracted from the user's utterance. 3. **Set Up a Dialogue**: In your dialogue flow, add a node that listens for the intent you created. When the intent is detected, the dialogue flow should proceed to a node that confirms the date and calls the "Booking" tool. 4. **Call the "Booking" Tool**: In the node where you confirm the date, you can set up an action to call the "Booking" tool with the extracted date entity as a parameter. 5. **Handle Objections**: Ensure that your dialogue flow can handle objections and loop back to the date confirmation if necessary. Since you're using the Vapi Dashboard, you should have access to a visual interface to create and manage these components. If you need specific instructions on how to use the Vapi Dashboard to set up these elements, please visit the dashboard and look for tutorials or help sections that guide you through the process. If you encounter any issues or have specific questions while setting up your triggers and booking tool within the Vapi Dashboard, please don't hesitate to reach out for more detailed support.
f
need further help, not sure how to set up the intent in the dashboard
s
Hey @fisch3r To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help me figure out what went wrong!
2 Views