io
autogen.io.IOWebsockets
IOWebsockets
A websocket input/output stream.
Initialize the websocket input/output stream.
Parameters:Name | Description |
---|---|
websocket | The websocket server. Type: autogen.io.websockets.ServerConnection |
Static Methods
run_server_in_thread
Factory function to create a websocket input/output stream.
Parameters:Name | Description |
---|---|
host | The host to bind the server to. Defaults to “127.0.0.1”. Type: str Default: ‘127.0.0.1’ |
port | The port to bind the server to. Defaults to 8765. Type: int Default: 8765 |
on_connect | The function to be executed on client connection. Typically creates agents and initiate chat. Type: Callable[[ForwardRef('IOWebsockets')], None] |
ssl_context | The SSL context to use for secure connections. Defaults to None. Type: ssl.SSLContext | None Default: None |
**kwargs | Type: Any |
Instance Attributes
websocket
The URI of the websocket server.
Instance Methods
send
Send a message to the output stream.
Parameters:Name | Description |
---|---|
message | The message to send. Type: autogen.messages.base_message.BaseMessage |