Time format conversions for the function call
# support
z
I have a custom function that needs a preferred time from the customer to book an appointment and I just want the string "tomorrow 2 pm" or "friday afternoon", but the vapi function call turns the string into a time format (also a wrong one). Example: preferred booking time from the customer is: "tomorrow 3 pm" but the vapi function turns that into "2023-10-17T15:00:00" How can I make sure that there will be no conversion and the function just uses the string? https://cdn.discordapp.com/attachments/1358695401179316316/1358695401531641897/Screenshot_2025-04-07_at_11.39.54.png?ex=67f4c733&is=67f375b3&hm=6d71db321f434d3f38c8631a3ec7b901751d7d1466e55388e223b626d7fd8a6e& https://cdn.discordapp.com/attachments/1358695401179316316/1358695401829568622/Screenshot_2025-04-07_at_11.39.08.png?ex=67f4c733&is=67f375b3&hm=38933f5555078cc34605b29b2c1fd62de348be9efd1c106fd24a7a28e5867334&
v
Hi there! 👋 I understand you're having an issue with time format conversions in your BrightSmile_Booking_CheckAvailability function. While I can't provide a guaranteed solution to completely prevent the conversion, I can share some approaches that might help. Based on the information I found, here are some potential ways to address this issue: ### 1. Disable Formatting According to the [Voice Formatting Plan documentation](https://docs.vapi.ai/assistants/voice-formatting-plan), you can try disabling formatting by setting:
Copy code
voice.chunkPlan.formatPlan.enabled = false
### 2. Use modelOutputInMessages You might want to try using
modelOutputInMessages
instead of transcribed output. This can be enabled by making an UPDATE request to your assistant:
Copy code
curl -X PATCH https://api.vapi.ai/assistant/insert-your-assistant-id-here \
     -H "Authorization: Bearer insert-your-private-key-here" \
     -H "Content-Type: application/json" \
     -d '{
  "modelOutputInMessagesEnabled": true
}'
### 3. Follow Best Practices for User Input The [Vapi Prompting Guide](https://docs.vapi.ai/prompting-guide) emphasizes: "Do not modify or attempt to correct user input parameters or user input, Pass them directly into the function or tool as given." ### 4. Time Format Information From what I can see, the BrightSmile_Booking_CheckAvailability function seems to expect the datetime parameter as a string in ISO format. The function returns available timeslots in formats like "2025-01-20T09:00:00+01:00" according to [Discord discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1330221332452999321). Is there anything specific about these approaches you'd like me to elaborate on, or would you like to try a different solution? Sources: - [Voice Formatting Plan documentation](https://docs.vapi.ai/assistants/voice-formatting-plan) - [Vapi Prompting Guide](https://docs.vapi.ai/prompting-guide)
z
I would like to try 1. to disable the formatting in the voice. can you elaborate on that how I can turn it off for date and times
k
Hey! 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 us figure out what went wrong!