Help for Custom Tool
# support
t
Hello, First of all, congratulations on your tool. We are looking to set up a wizard with a Custom Tool that retrieves order information via an ID. We have a url, on which we pass in the body “raw”, this information :
Copy code
{
  "message": {
    "type": "function-call",
    "functionCall": {
      "id": "OUR-TOOL-ID",
      "name": "getOrderInformations",
      "parameters": {
        "orderId": 821822
      }
    }
  }
}
This returns the following code:
Copy code
{
  "results": [
    {
      "toolCallId": "OUR-TOOL-ID",
      "result": "The status of order 821822 is : In delivery"
    }
  ]
}
However, when we communicate an order ID to the voice assistant, it always tells us that it can't find an order with our ID. Can you help me? Thanks in advance for your help https://cdn.discordapp.com/attachments/1274711176818987018/1274711177057800232/Capture_decran_2024-08-18_a_14.46.22.png?ex=66c33ecb&is=66c1ed4b&hm=ba6aed86ac5e8e001f9073cba79d933c3442d4aeeb1d2bbc3744e61a4a43c2bc&
v
@Thibaut Hello! Thank you for your kind words, and I'd be happy to assist you with setting up your wizard to retrieve order information. It seems like there might be an issue with how the voice assistant is handling the order ID input or how it's communicating with your custom tool. To help you effectively, I would need to understand a few more details: 1. How is the order ID being communicated to the voice assistant? Is it through voice commands, and if so, is there a speech-to-text component that might be misinterpreting the numbers? 2. Is the voice assistant configured to make a POST request to your server URL with the correct body format as you've described? 3. Have you verified that the voice assistant has the correct permissions and is using the proper authentication method to access your custom tool? Once we clarify these points, we can proceed to troubleshoot the issue further. If you have any logs or error messages that the voice assistant is producing, that would also be very helpful in diagnosing the problem.
You can continue this conversation by mentioning me in the message.
t
v
@Thibaut Great, it's good to know that the voice assistant is correctly understanding the order number. Since the issue is not with voice recognition, we should look into how the assistant is interfacing with your custom tool. Here are a few steps we can take to troubleshoot the issue: 1. **Check the Integration**: Ensure that the assistant is correctly configured to make the POST request to your URL with the necessary headers, method, and body format. 2. **Review the Custom Tool Configuration**: Verify that the custom tool is set up to accept the parameters in the format the assistant is using and that the
orderId
is being passed correctly. 3. **Test the Connection**: If possible, manually make a POST request to the custom tool using a tool like Postman or cURL with the same parameters to see if the correct response is returned. 4. **Error Handling**: Ensure that the assistant has proper error handling to catch any issues that may occur during the API call to your custom tool. 5. **Logs**: Check the logs for any errors or messages that could indicate what might be going wrong when the assistant attempts to retrieve the order information. If after these steps the issue still persists, it might be helpful to provide a specific error message or behavior that the assistant is exhibiting when it fails to find an order with the provided ID. This will help narrow down the cause of the problem.
v
@Thibaut It's great to hear that your tests with Postman are successful. This indicates that your custom tool and server are functioning correctly when the request is properly formatted. Since you're experiencing issues with the voice assistant integration but not with Postman, the problem likely lies in the way the voice assistant is sending the request or handling the response. Unfortunately, without seeing the PHP code or the specific implementation details of your voice assistant, I can't provide a precise solution. However, I can suggest some general steps to debug the issue: 1. **Logging**: Add extensive logging on the server-side to capture the incoming requests from the voice assistant. Compare these logs with the successful requests from Postman to identify any discrepancies. 2. **Request Validation**: Ensure that your PHP code validates the incoming request and responds with a clear error message if the request is malformed or missing required parameters. 3. **Voice Assistant Configuration**: Double-check the voice assistant's configuration to ensure it's making the request with the correct method (POST), headers, and body format. 4. **Error Handling**: Implement robust error handling in the voice assistant's code to capture and log any errors or non-successful HTTP status codes returned by your server. 5. **Testing**: If possible, create a test environment where you can simulate voice commands and monitor the system's behavior in real-time. If you're still unable to resolve the issue, please provide more details or error messages that you're encountering, and I'll do my best to assist you further. If you have specific questions about your PHP code, feel free to share relevant snippets (ensuring there's no sensitive information), and I can take a look.
t
cc @User
s
send the latest call_id
t
Thanks for your answer. Here : 3b2c913b-9b74-45e9-acd0-8ae07538bf60
s
You will need to add the property once again in tool and click on save button then publish button. It will fix your issue