microsoft / autogen

A programming framework for agentic AI 🤖
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
30.75k stars 4.48k forks source link

[Question]: How should I implement streaming output to the frontend like OpenAI and do you have any specific examples #3179

Open rebootPeng opened 1 month ago

rebootPeng commented 1 month ago

Describe the issue

How should I implement streaming output to the frontend like OpenAI and do you have any specific examples

Steps to reproduce

No response

Screenshots and logs

No response

Additional Information

No response

LittleLittleCloud commented 1 month ago

I feel like this is out of scope? The answer will be specific to which tech stack you are using.

Maybe worth looking at how the streaming messaging is implemented in other popular front-end framework like chatbot-ui

For example, here is how chatbot-ui streaming the chunks: https://github.com/mckaywrigley/chatbot-ui/blob/81328b61d2a4ab597a7a057be70e785cf756d9f8/components/chat/chat-helpers/index.ts#L281C14-L281C30

Which essentially update the text content in given ChatMessage when a new chunk arrived

rebootPeng commented 1 month ago

I use Python for the backend and Vue for the frontend. Do you have any related examples @LittleLittleCloud