My input is basically an HTML, How can chat-gpt return the reposnse in valid html tag

hi Guys,

I have to send html to api and ask api to improve the html as html has some kind of email structure.
but api is returning me response in html but each chunk is not proper html
it is like <, p, >, some text, <, />
while I want each chunk as <p>some text</p>
which will reduce the number of chunks used and rendering will become faster on front end.

any suggestions will he helpful.

thanks in advance

For streaming, we’ve had a few threads recently…

Are you using the latest OpenAI library or custom code to stream?

If you search the forum, there’s a few other threads too that should help.

Have you considered just letting it output markdown and then convert the markdown before sending to the api?