I have a streaming response object from an LLM.
I write it in a streaming manner with
st.chat_message(“assistant”).write(response)
That’s great.
Now I want to append the message that I wrote to the chat history:
st.session_state.messages.append({“role”: “assistant”, “content”: msg})
But how do I get the msg from the response object after it has been written?
I do not succeed in doing this…