Criei um fluxo no make que integra um assistant openAI com whatsApp, entretando algumas mensagens de resposta apesar de darem o resultado no modulo da openAI, quando é para ser enviada pelo HTTP da o seguinte erro: {“type”:“jakarta.ws.rs.WebApplicationException”,“code”:400,“error”:“HTTP 400 Bad Request”}
E não envia a mensagem… isso apenas para alguns resultados, poderia me ajudar sobre?
I created a flow in Make that integrates an OpenAI assistant with WhatsApp. However, some response messages, despite returning results in the OpenAI module, give the following error when they are sent via HTTP: {“type”:“jakarta.ws.rs.WebApplicationException”,“code”:400,“error”:“HTTP 400 Bad Request”}
And the message is not sent… This happens only for some results. Could you help me with this?
blueprint.json (146.8 KB)
module-output-bundle.txt (1.5 KB)
Welcome to the Make community!
If you need further assistance, please provide the following:
1. Screenshots of module fields and filters
Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at. You can upload images here using the Upload icon in the text editor.
2. Scenario blueprint
Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.
3. And most importantly, Input/Output bundles
Please provide the input and output bundles of the modules by running the scenario (or get from the scenario History tab)
then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.
Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.
Following these steps will allow others to assist you here. Thanks!
Join the Make Fans Discord server to chat with other makers!
Okay, I uploaded the files you asked me to do.
What happens is the following, the flow continues normally until the openAI Assistant returns. When sending in the HTTP module, the problem occurs, some messages are sent, and others show this error.
Do you have an example of one that succeeds so it can be compared to one that fails? Also, you have two paths. Is it only one path that has a problem?
L
module-output-bundle - succeeds.txt (1.7 KB)
It follows the same pattern, the difference is that the first time the user sends the message it follows the flow above, capturing some information, after this information is captured, it uses it as a basis to move on to the flow below.
Yes, the error happens on either of the two routes.
In the successful call, you have this:
{
"name": "transfer-encoding",
"value": "chunked"
},
{
"name": "content-encoding",
"value": "gzip"
}
In the unsuccessful one you don’t have that. So there may be something earlier in the flow that affects the output. I’m not sure where in the process the encodings are added, but a good place to start is by looking at the content of the bundles to see if the problem is during the initial call or if it’s transformation somewhere in the process.
L
I still haven’t been able to solve the problem, could anyone help?
After a long period of testing the flow and trying to solve the problem, I found that the error occurs when the Assistant’s response includes quotation marks “”. Therefore, this special character is preventing the message from being sent. Is there any way to handle removing only the quotation marks from the text?
If you want to use WhatsApp natively inside Make, check out this tutorial [1] we created for exactly your need: WhatsApp + OpenAI’s assistant API.
[1] Integrate ChatGPT and WhatsApp using Make and 2Chat