Streaming response from OpenAI integration

Hi!   I am building an application in which an Integration with OpenAI is used to generate a quite long text. To make the user experience better I want to use the option stream = true in OpenAI to deliver the response in small chunks and then print them in the front end similarly to the ChatGPT UX.    I have built a Java Action where I recieve the response as a stream and for each small chunk I try to change and commit the attribute in the object displayed on the page. However, the client does not seem to recieve the changes until the entire Java Action has finished.    Does anyone know how to continously update the value of an object during a Java Action and immediately display the changes in the client?    Thank you in advance! 
0 answers