function help
# support
i
I'm creating an assistant that is required to gather x information for the purpose of the call. I understand I need to create a tool and have both the system prompt and the function set x information that is needed but do not understand if I need to use the function type tool or if it would be better to use the endcall tool type since the information should only be sent at the end of the call. TLDR:: What does endcall type tool do differently than function type tool? Please let me know if any of my other assumptions are incorrect for what I'm trying to do. Thanks! 🙂
v
@ImEgg I'm glad to hear about your project to create an assistant! To clarify the difference between the function type tool and the endcall type tool: - A function type tool is a general-purpose tool that you can use to perform a specific action or set of actions during the call. It can be invoked at any point in the conversation when you need to perform a task, such as gathering information, processing a request, or any other functionality that your assistant requires. - An endcall type tool, on the other hand, is specifically designed to be used at the end of a call. It typically involves actions that are meant to occur as the call is being concluded, such as sending collected information, finalizing a transaction, or providing a closing message to the user. Based on your description, if the x information needs to be gathered throughout the call and then sent at the end, you would likely use a combination of both tool types. You would use the function type tool to collect and set the necessary information during the call, and then use the endcall type tool to send the information and properly end the call with the appropriate message or action. Your assumptions seem correct for what you're trying to do. You would create a tool to gather the required information (function type tool) and then use an endcall type tool to handle the end of the call, ensuring that all necessary actions are taken before the call is concluded. If you need further assistance or have more questions, feel free to ask!
You can continue this conversation by mentioning me in the message.
i
@Vapi Why would I use both a function type tool and a endcall tool together for this use case? wouldn't just setting the fields for x information to required force the conversation to continue until those requirements are satisfied? or that the purpose of the function tool, to check and validate that x information has been collected? if this is the case does anything really needed to be added to the system prompt saying something like: "During your conversations make sure to gather this x information" is it better to do the function tool validation or have it be apart of the system prompt?
v
@ImEgg Using both a function type tool and an endcall tool together can be beneficial for a few reasons: 1. **Function Tool for Collection and Validation**: The function type tool can be used throughout the conversation to collect and validate the x information. This ensures that the information is gathered correctly and meets any specific criteria or format required. It can also handle complex logic, such as branching conversations based on user input, which might not be easily specified in a system prompt. 2. **Endcall Tool for Finalization**: The endcall tool is used to ensure that all necessary actions are taken at the end of the call, such as sending the collected information to the appropriate system or database, providing a summary to the user, or setting up a follow-up if needed. Setting fields for x information to required does indeed force the conversation to continue until those requirements are satisfied. However, the function tool's purpose is to actively manage that process, providing prompts, error handling, and guidance to the user as needed. Regarding the system prompt, it's still useful to include instructions like "During your conversations make sure to gather this x information" because it sets clear expectations for the assistant's behavior. It serves as a guideline for the assistant to follow and can be a reminder to ensure that all necessary information is collected before the call ends. In summary, it's not necessarily a matter of choosing between function tool validation or system prompt instructions. Both can be used together to create a robust system. The function tool actively manages the data collection and validation process, while the system prompt provides the overarching instructions for the assistant's behavior. Using both ensures that the assistant is both effective in its task and aligned with the intended user experience.
a
Use functions for things needing to happen during an active call. Use end of call report for everything else.
i
and so I understand correctly, end of call report is different from the endCall type tool, right?
Follow up on this. I also noticed that there is a Call analysis plan to get structured data and I can supply a schema just the same as with endofcallReport. What's the difference here and why would I use one over the other for my usecase?
c
I was going to say you don't need a tool to grab data at all. Your Structured data can do that by itself with no problem.
s
@ImEgg sorry for the late response, checking if your doubts are resolved by now??
i
yea, all is set