st.write(response) ----not recognising the \n\n
st.write(" Based on the provided table, the input with the highest electricity production value on October 4, 2023 was:\n\nBuilding 353, with a value_sum of 0.49414 MW.") ----when copied and pasted in side the write function it works fine.
You can try with st.markdown(response)
Markdown also gives the same issue.