Replies: 2 comments 3 replies
-
@Rishat7c Thanks for bringing this up 👍 The code that you shared above seems to be fine, so it currently seems like this isn't a problem caused by ReactPHP. I'm not quite sure what your expected result is and what you're currently getting back, can you go a bit more into detail? Are you getting one result at the end but expect to receive each chunks individually? This could also be related to how your application is configured. For instance, if you're using an Apache server, it may be the reason why you're receiving a single answer, as Apache utilizes buffering logic. Another possibility is that RASA may not fully support streaming, or perhaps you're not using it correctly - just speculating here. Interested in your input on this. |
Beta Was this translation helpful? Give feedback.
-
Hello @SimonFrings My client configuration (OpenServer):
When I access an external RASA API server from my website, I receive an array of messages as a result. Each message arrives with a short time interval (more details on the screenshot). I marked the runtime output in the code and it is displayed only when the server returns a complete response. I want to process each message separately, rather than wait for a complete response from the server. Please tell me, is this really possible to implement using PHP and ReactPHP? |
Beta Was this translation helpful? Give feedback.
-
Stream receiving messages in ReactPHP (client)
Hi all. There is a RASA server (external server) and my website in PHP, where a custom widget in JS is located. Everything works perfectly.
The RASA documentation states that the RASA service supports streaming messaging. In the request to the RASA API that we are making, we added the stream=true parameter, then the responses should not arrive in a batch at once, but one after another as they arrive. For the user, this will mean that the bot responds instantly.
To implement this solution, we connected ReactPHP.
Nothing has changed. Responses come when the request is completed completely. Tell me, what am I doing wrong?
Please share your thoughts or solutions
I am publishing my solution (it is not working, i.e. the answer comes when the request is fully processed)
Beta Was this translation helpful? Give feedback.
All reactions