Struggling to stream openAI output and preserve spacing and strong html tags
hey guys so im basically using the openAI SDK for a project and im struggling to operate the stream functionality to live update the UI each time
if anyones experienced with streaming the openAI output id gladly love some help
heres my code
so openAI returns the stream in chunks starting with
data:
but in my prompt ive told them to follow a strict format which i believe they do that preserves the line spacing between paragraphs and also includes the strong html tags in the output as ive prompted the AI to do but it doesnt seem to work the linespacing are ignored 😦

3 Replies
here in the first pic u can see that the strong tag for IDEA 1 isnt rendered as its split across chunks so its not rendered in the html
my prompt is the second ss telling openAI to render the strong tags and u can see the format has spaces between paragraphs
heres the portion for
idea 1
i really need some help as to what im doing wrong, been stuck on this for over a week
(just going to pre-emptively mod-voice in here that this post is asking for help with an issue, not a tirade on why AI is inherently unusable for this use case. If you have nothing to say about how to solve the issue at hand, please don't respond to the post)