microsoft / autogen

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

[Issue]: How to use IOWebsockets with Flask? #2611

Open Tylersuard opened 6 months ago

Tylersuard commented 6 months ago

Describe the issue

Currently every example of websockets in the agentchat_websockets.ipynb notebook involves creating a server like so:

with IOWebsockets.run_server_in_thread(on_connect=on_connect, port=8765) as uri:

I do not want to use this server, I want to use Flask. I have written a wrapper around the IOWebsockets object and passed in my websocket as an argument. The code runs but nothing ever gets sent back across to the frontend. How can I use the IOWebsockets class without the .run_server_in_thread method?

Steps to reproduce

No response

Screenshots and logs

No response

Additional Information

No response

Tylersuard commented 6 months ago

@davorrunje

Tylersuard commented 6 months ago

A second question: in one of the examples we are creating a websockets server inside a FastAPI server. Why are we creating 2 servers?