Incorrect date and refusal to interact
# support
m
For some inexplicable reason, the Vapi assistants assume that we are in the year 2023 and consistently and stubbornly offer suggested dates in the past. When asked what the current date is, the answer is evasive, stating that the AI does not have this information. Based on this situation, my n8n workflow (slave) tells vapi (master) the current date to the vapi assistant immediately when the webhook is activated, even before anything else happens. (The prompt of the assistant says: Ask n8n first for the current date, directly after the webhook is a node for the current date, which reports directly to vapi via Respond to webhook bypassing the AI agent and in the prompt of the AI agent, which itself can also access the date again via a tool, it says that the first thing to do is to pass the date to vapi. So I can see how the workflow is executed and yet vapi refuses to recognize that we are in the year 2024 during the ongoing conversation. What is going on? I refuse to believe that I am the only one facing this problem.
v
@MediaMaxe I'm sorry to hear about the trouble you're experiencing with the date recognition in VAPI. It seems like there might be an issue with the synchronization of the current date within the system. To address this, we should ensure that the date provided by n8n is being correctly received and processed by VAPI. To troubleshoot this issue, I would recommend the following steps: 1. Verify that the n8n workflow is correctly configured to send the current date in the expected format to VAPI. 2. Check that the VAPI assistant is properly configured to receive and update its context with the current date from n8n. 3. Ensure that any subsequent requests to the VAPI assistant include the updated context with the correct current date. If these steps do not resolve the issue, it may be necessary to look into the VAPI system logs or contact support for further assistance. Please let me know if you would like to proceed with any specific actions or if there's anything else I can assist you with.
You can continue this conversation by mentioning me in the message.
m
Thanks for the suggestions. Let me provide more details about the issue: Webhook Payload: My n8n workflow sends the following JSON as the first message to Vapi: json Copy code { "currentDate": "2024-12-02T12:00:00.000Z", "timePreference": "default", "datePreference": "default", "status": "success", "message": "Datum und Präferenzen erfolgreich übermittelt." } The currentDate field is in ISO 8601 format. The Problem: Despite this, the Vapi agent consistently defaults to the year 2023 in suggestions and ignores the correct currentDate. This issue persists even though the webhook data reaches Vapi successfully. Questions: Is ISO 8601 the correct format for the currentDate? How can I verify if Vapi processes and applies the currentDate field? Are there logs to debug how webhook data is integrated into the agent’s context? Prompt Update: My agent’s prompt explicitly instructs it to use the currentDate value: "Use the current date (currentDate) provided by n8n to suggest appointment times." Despite this, the agent still defaults to the wrong date, suggesting an issue with data handling on Vapi’s side. Please clarify how to ensure the webhook data is correctly processed and applied. Thank you! Best regards, MediaMaxe Team
v
@MediaMaxe Thank you for providing detailed information about the issue, MediaMaxe Team. To answer your questions: 1. **ISO 8601 Format**: Yes, ISO 8601 is the correct and widely accepted format for date and time representations in APIs. Your format "2024-12-02T12:00:00.000Z" is correct. 2. **Verifying VAPI Processing**: To verify if VAPI processes and applies the
currentDate
field, you would typically look for a confirmation response from VAPI or check the system's state after the webhook call. If VAPI does not provide a clear confirmation, you may need to check the documentation or contact support for details on how to verify this. 3. **Logs for Debugging**: Logs are the primary means to debug how webhook data is integrated into an agent's context. If VAPI provides logging capabilities, you should be able to access them to see how the data is being handled. If logs are not accessible or do not provide the necessary information, contacting support would be the next step. Given that the agent is not using the provided
currentDate
, there might be a problem with how the agent's context is updated after receiving the webhook payload. Here are a few steps you can take: - **Review the Agent Configuration**: Ensure that the agent is configured to update its context with the
currentDate
from the webhook payload. - **Check the Agent's Code**: If you have access to the agent's code or configuration, look for any hardcoded values or logic that might be overriding the
currentDate
. - **Contact Support**: If the above steps do not resolve the issue, it may be necessary to contact VAPI support for assistance. They should be able to provide insights into how the agent processes webhook data and help resolve the issue. If you need further assistance or would like me to perform any specific actions, please let me know, and I'll be happy to help.
s
Do let me know if you require anything else.
4 Views