Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Tylersuard opened this issue May 6, 2024 · 2 comments
Open

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

Tylersuard opened this issue May 6, 2024 · 2 comments
Labels
streaming Streaming output to websocket

Comments

@Tylersuard
Copy link
Collaborator

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 Tylersuard changed the title [Issue]: How to use websockets with Flask? [Issue]: How to use IOWebsockets with Flask? May 6, 2024
@Tylersuard
Copy link
Collaborator Author

@davorrunje

@Tylersuard
Copy link
Collaborator Author

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

@ekzhu ekzhu added the streaming Streaming output to websocket label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
streaming Streaming output to websocket
Projects
None yet
Development

No branches or pull requests

2 participants