Is there a way to pass metadata between different ...
# support
k
For example, if I get the date in the first interaction and an ID in the second interaction, is there a way to get both by using different functions? Or how would I have to handle this to not have cache this info on my side and get it from the API request
s
I didn't understand your question. Could you elaborate?
s
Just return the info via http response to the conversation.. it'll be available from chat history
k
Mhm, @Sangy you mean doing something like this in the json response?
Copy code
json
{
 "result": "context for the bot...",
 "metadata": "this is my metadata",
}
Of course. How can I pass info gotten in previous interactions. For example, If I have a flow where I ask the user's name, I execute a function, and then I ask for a phone number, and let's say I want to associate the name with the number, is there a way for me to get the name again without having to store it in an external place but instead getting it from the API request?
s
Let me guess you are talking about remembering information about previous customers who are already registered by you. For example: I called to your voice bot and I provided my name like Sahil and my phone number. So, the next time I call your voice bot it should do something like hello sahil (basically remember the previous context) correct? It can be achieved via like storing all the information into your storage location and on inbound call you can retrieve that particular data before the inbound call starts. Refer to this documentation: https://docs.vapi.ai/technical_support
k
Hey @Sahil thank you for answering. That’s not what I meant, I’m sorry about my bad explanation, let me explain it again with an example. I have an inbound voicebot. The user will call and provide different data like the name and phone number. Each time the user provides a value, we execute a custom function. eg. 1. Hello, my name is Kai (Custom functions checks name is in the database and asks for phone number) 2, My phone number is … (Custom function checks phone number and name matches) In this last step, is there a native way to pass the name inside the API params so I don’t have to get it from the conversation transcription which could not be 100% accurate? For example in other APIs like Stripe or Clerk you can pass public and private metadata and associate it with an user (in this case I want to associate it with the call)
s
You can directly mention to the Assistant to provide the name as well to the final API call. The thing is Vapi understands the context (underneath have access to previous data). So, if you directly tell him to provide the name as well then it will be able do it. Note: You might need to do little bit prompting to say that remember this data cause in the final call you need to send this data as well.
k
Understood! Thanks Sahil
s
You are welcome.