Hallucinating tools response
# support
b
Hello. I have an assistant that is made to get today's time. I created a tool with the following spec: { "type": "function", "messages": [ { "type": "request-start", "content": "How do you feel?" }, { "type": "request-complete", "content": "So today's time is is" }, { "type": "request-failed", "content": "I couldn't get the current time information right now." }, { "type": "request-response-delayed", "content": "It appears there is some delay in communication with the time API.", "timingMilliseconds": 2000 } ], "function": { "name": "GetTodaysTime", "description": "Use this tool to get today's time" }, "async": true, "server": { "url": "https://hook.us1.make.com/btjnlkr8x1na3mqfafy8mvtxmrbw09er" } } I made a make scenario and I make sure the response returned looks like the following: {"results":[{"result":"12:01","toolCallId":"call_ZSYgW6OKknzU664Hg3UjX4es"}]} Always I made sure to add "Tool Calls" in the ClientMessages and ServerMessages section as per the documentation. The assistant still hallucinats the response and will say 10AM instead of 12:10 (It's 12:10 for me now)
v
Hi @Benjamin E., I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Tools Calling]() * [Server Events]() * [Prompting Guide]() * [Get Assistant]() -----------------------------
### Answer It seems you are facing an issue where the assistant is not accurately reflecting the time returned by your function. This could be due to a variety of issues related to the handling of the function's response or the assistant’s interpretation of that response. Here are a few steps you can take to troubleshoot and potentially resolve this issue: 1. Verify the Assistant Configuration: Ensure that the assistant is correctly configured to listen to and process the server responses. This includes making sure the
Tool Calls
are properly added and recognized in both
ClientMessages
and
ServerMessages
settings as you've done [(1)]() . 2. Check Response Handling: Confirm that the assistant’s logic for handling the response from the server is set up to accurately parse and utilize the
"result"
field in the JSON payload you provided. It's essential that the assistant correctly maps this result to the output speech or text. 3. Debug the Tool Configuration: Review the tool configuration, especially the
messages
associated with the
request-complete
event. Make sure that the message dynamically includes the result from the function call. It’s possible the message is hardcoded or not correctly appending the result which might be causing the incorrect time announcement [(2)]() . 4. Inspect Latency and Timing: Since you have asynchronous behavior enabled (
"async": true
), check if there is any issue with how the responses are being managed temporally. Delays in processing could lead to outdated or incorrect information being presented if not handled correctly. 5. Review Server Logs: Check the logs on your server that is hosting the function (
https://hook.us1.make.com/...
). Look
for any discrepancies between what is being sent and what the assistant seems to be receiving or interpreting [(1)]() . If after these checks the issue still persists, it might be a deeper integration or a bug in the handling of asynchronous function calls within the assistant. In such a scenario, further detailed logging and step-by-step tracing of data flow from the server to the assistant and finally to the user output would be necessary to isolate the issue. By following these troubleshooting steps, you should be able to get a clearer picture of where the breakdown is occurring in the expected flow of information from your time retrieval function to the assistant’s response output.
s
You must be returning the time in the wrong timezone. Please check it.
2 Views