Formatting response in streaming #204
-
How can we format response while we stream the api output so that the output looks better. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
this can be handled with vanilla css on the frontend |
Beta Was this translation helpful? Give feedback.
-
You can take some inspiration from the vercel chatbot template. https://github.com/vercel-labs/ai-chatbot For newlines and indentation, you can simply apply For markdown, you can use Remark, like in that template above, but its slightly more complicated depending on your framework and SSR. |
Beta Was this translation helpful? Give feedback.
-
Ok i'll have a look. |
Beta Was this translation helpful? Give feedback.
You can take some inspiration from the vercel chatbot template.
https://github.com/vercel-labs/ai-chatbot
For newlines and indentation, you can simply apply
white-space: pre-line
to whatever element renders content from gptFor markdown, you can use Remark, like in that template above, but its slightly more complicated depending on your framework and SSR.