https://retellai.com/?utm_source=discord&utm_medium=seo logo
cal.com check availability and book appointment fu...
# ❓・bug-report
u
The function finds unavailable times but never says it in words it just returns the result of the tool, how do I prompt the AI to tell the user all the available times and only once the time is confirmed, then trigger the book appointment function? I've also seen that it books unavailable time which I don't get? I also want the agent to tell the user the appointment has been booked at that specific time they wanted if available. I'm attaching my JSON file below https://cdn.discordapp.com/attachments/1438984963008757841/1438984963570667662/Lead_Reactivation_Agent_Template_1.json?ex=6918deae&is=69178d2e&hm=6e2d874577f142cab79642418925e3e90db0246df639702ded1cfdb76be596a7&
a
Hi! I can help you fix that. It sounds like your agent needs clearer prompting logic to (1) list available times in natural language, (2) only call the booking function after the user confirms a specific slot, and (3) avoid booking unavailable times. If you share your JSON file here, I can review it and adjust the prompts so the workflow runs smoothly. @Usman
@Omar Ashraf | Community Lead @Colin - Integrations @ Retell AI
c
check the return result of the custom function, then prompt your agent accordingly
u
What do you mean? Can you help me edit ir?
o
Hello @Usman , can you provide a call id
u
@Omar Ashraf | Community Lead call ID from where?
o
When it did book unavailable time
u
I don't know where to find that, it was last week. Can I give you my agent ID and CF ID
agent_d41dddbbb4147cf1e06687156a
conversation_flow_0b9799994f3d
I think it's do with my prompting, mind having a look there?
o
you still face this problem right , if you can make a new call so i can see where is the problem is but just reading the prompt won't really help i need to see the problem it self.
u
But its definitely the prompting so how would I make it say the times
@Omar Ashraf | Community Lead Here is the call ID: call_107d50aed7175f598a07c86bdbe when the lead booked 11 AM pacific when it was unavailable.
o
Hello Usman , Till now i see two problems - second its not saying it available or not because you don't send it to a conversation node to say the function result you sending it right a way to the next function - if it's available or not they are going into the same path -> booking function https://cdn.discordapp.com/attachments/1438984963008757841/1440725178186338335/image.png?ex=691f3361&is=691de1e1&hm=00556169a35a5a79836ed15198ba9b0b80f73339c62084674a8bccf4376d948c&
u
@Omar Ashraf | Community Lead how do I get the conversation node to say the function result? That's what I'm finding hard right now..
o
You can put a conversation node after the function so the agent able to talk after the function execution
u
@Omar Ashraf | Community Lead Is there a prompt I need it to follow in the conversation node like, "Please tell the owner the times that are available which is found in the result of the check_avaibility_cal function."
o
You can try different prompts it and see what response you like.
u
But that's what you'd do I.e prompt in the conversation node to use the result and tell all available times? Or is ther anything else?
@Omar Ashraf | Community Lead Solved
o
Great!