Tool response is not being verbalized by the agent
# support
s
Hello I am trying to use tools using the API, and the tool is working correctly and returning a response however the assistant is not saying the response immediately even if the request is already complete. I always have to say something again before it tells me the tool output. How do I fix this and what are the possible causes of this bug? CALL ID: 44b38ec3-c0ad-44b6-9fde-8a232670acb6 Thank you! This is what my API returns:
Copy code
return jsonify({
                 "results": [
                     {
                       "toolCallId": tool_call_id,
                       "result": result_string
                     }
                   ]
               })
Then I have attached a photo of a code snippet of how I am using the tool in my code: https://cdn.discordapp.com/attachments/1250177958979702805/1250177959856308275/image.png?ex=6669fe74&is=6668acf4&hm=e6b33351bea49ebbf42b63bd59a82b97fd2315371dc98e5094a812029904cd5c&
v
message has been deleted
@Sheyn It sounds like you might be encountering an issue with asynchronous handling of the tool's response. When you're using tools that return a response, it's important to ensure that your assistant is configured to handle the response correctly. From the information you've provided, it seems like the assistant might not be configured to output the response immediately after the tool has completed its task. This could be due to the assistant waiting for an additional trigger to provide the output. To address this issue, you should check the following: 1. Response Handling: Ensure that your assistant's logic is set up to listen for the tool's response and then output it as soon as it's received. 2. Asynchronous Configuration: If you're using the
async: true
parameter, the assistant will not wait for a response. Make sure that you only use this parameter if you do not need to return a response immediately. 3. Webhook Configuration: If you're using webhooks to receive the tool's response, ensure that they are correctly set up to send the response back to the assistant. 4. Code Review: Review the code snippet where you're calling the tool to make sure it's designed to handle the response correctly. Unfortunately, without seeing the code snippet, I can't provide specific guidance on what might be wrong. If you're still having trouble after checking these areas, please provide the code snippet or more details about how you're calling the tool, and I'll do my best to assist you further. If the issue persists, you may need to reach out to support for more in-depth troubleshooting.
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
s
Can you once set the request-start message to an empty string and give it a try?
s
Hi so I tried setting it to an empty string but I was still having the same issue so I tried removing the request-start message completely and now it's fixed. https://cdn.discordapp.com/attachments/1250177958979702805/1250778041056100423/image.png?ex=666c2d53&is=666adbd3&hm=c5d00c84434db64f2c5ae778c4c85edfcacfd95f494413fda2d2af7400ef9216&
2 Views