https://retellai.com/?utm_source=discord&utm_medium=seo logo
Calling Webhooks In The Middle of A Call
# ❓・bug-report
f
Is it possible to call a webhook in the middle of a call and inject the results in to the script such as searching for available products? We need to match the lead to specific products based on their responses to questions previously asked.
j
Why a webhook , just use a tool (function node) to get some data and inject it as variable
f
I am not familiar with all the features of Retell AI as we are exploring options. We have set up a test Agent to see if this will work for us but we are stuck at this point because according the the documentation I would have to pass every variable possible at the beginning of the call. Is there a way to get responses and inject data during the call via API calls?
c
you'll have a list-products custom function, and when posting it, format it using the json parameters, the llm will know where it grabbed the data from
f
Can that be populated during the call based on answers to questions or does it have to be populated before the call starts?
c
you can call the function whenever
in your prompt you'll just say "call function 'list-products' to get a list of every product, then when the caller asks for a specific one, verify it's there then call function 'redeem-product' with that parameter"
or something similar
f
Thank you, I will have my team look into this fuctionality.
c
@Colin - Integrations @ Retell AI I'm piggybacking on this question... Once LLM sends a get request via a custom function is it able to understand a response and say for example an array of values, such as an array of available times? Been struggling to make agent understand the responses from the targeted end point. Thanks
c
yes it can, just try to send data with a decent pattern for the llm to understand
for example i had this custom function that returned 300 people to transfer too, then i had the json format the post request to transfer to the exact format
c
@Colin - Integrations @ Retell AI We are only doing a Get request at this point. And the backend is properly returning via JSON available time slots for that day but the Agent seems to not understand the response and it makes up its own available times. Have not been able to correct this so far.
c
must be a prompting issue then, give it strict instructions
f
Just a follow-up to close this out. Custom Functions was exactly what we were looking for and give us the functionality we needed to interact in real-time with the agent.