EvolutionAPI / evolution-api

Evolution API is an open-source WhatsApp integration API
https://evolution-api.com
GNU General Public License v3.0
911 stars 479 forks source link

[EN][BUG] #607

Closed mdenari closed 3 weeks ago

mdenari commented 1 month ago

Title: [Brief Description of the Bug]

Description:

Describe in detail the problem you encountered. Include any relevant context that may help understand the origin of the bug. I have a situation where using Flow Builder that accesses an AI via API, when the AI responses include a menu of options, the responses appear correctly in the Flow Builder's conversation simulation screen, but on the client's WhatsApp, only part of the response is displayed. I understand that since the internal test chat of the Flow Builder shows the complete response, it seems that the EvolutionAPI is truncating part of the AI's response. See the attached images.

Steps to Reproduce:

  1. Using the Typebot Chatbot connected to the EvolutionAPI, the chatbot sends an API request to Flowise with a client's question, in the example "hi" (highlighted in orange). The AI running Flowise with OpenAI responds in "response" and returns the text along with the choice options, as you can see in the image. image 👆As you can see in the image above, within the chatbot environment, it receives the message and the response options.

In the client's WhatsApp connected to the EvolutionAPI, the AI response passed through the Typebot Chatbot is not fully displayed on the client-side via WhatsApp. The text is not completed.👇 image

In the client's WhatsApp connected to the EvolutionAPI, the AI response passed through the Typebot Chatbot is not fully displayed on the client-side via WhatsApp. The text is not completed.👇

{"text":"Ótimo, Mauricio! Agora, qual é o objetivo principal que você deseja alcançar na academia? Por favor, escolha uma das opções abaixo:\n\n1. Perder Peso.\n2. Ganhar Massa Muscular.\n3. Melhorar Condicionamento.\n4. Aliviar Stress.","question":"13981283322","chatId":"","chatMessageId":"272169fc-ced4-4e60-a032-da983cb4da0b","memoryType":"Upstash Redis-Backed Chat Memory"}

Expected Behavior:

I expect the entire message received from the AI to be sent to the frontend to which the Evolution API is connected.

Current Behavior:

As explained above, not the entire message sent by the backend reaches the frontend connected to the EvolutionAPI, as demonstrated above.

Environment:

Resolving this issue is crucial for deciding whether to use EvolutionAPI for new developments using new AI tools like Flowise, CrewAI, Dify, and Relevance.

mdenari commented 1 month ago

replace de text send by Flowise AI, 👇see the complete message returned by the AI API; the only distinct condition is an "n/n", which might be interpreted as the end of the message. This part is not sent by Evolution to the client.

{"text":"Ótimo, Mauricio! Agora, qual é o objetivo principal que você deseja alcançar na academia? Por favor, escolha uma das opções abaixo:\n\n1. Perder Peso.\n2. Ganhar Massa Muscular.\n3. Melhorar Condicionamento.\n4. Aliviar Stress.","question":"13981283322","chatId":"","chatMessageId":"272169fc-ced4-4e60-a032-da983cb4da0b","memoryType":"Upstash Redis-Backed Chat Memory"}