pub async fn spawn_web(
ui_state: Arc<Mutex<UiState>>,
broadcast_tx: Sender<WsMessage>,
config: WebConfig,
) -> (SocketAddr, Receiver<String>)Expand description
Spawn the web server on a Tokio task.
Returns the bound address and a receiver for chat messages sent from the
browser (via POST /api/chat or {"type":"chat"} WebSocket messages).
Read from the receiver in your agent loop to drive conversation turns.
The server runs until the Tokio runtime shuts down.
ยงArguments
ui_stateโ Shared agent state (same instance passed toUiEventHandler).broadcast_txโ Sender half of the WebSocket broadcast channel. Pass the same sender toWebBroadcastHandler::new().configโ Server configuration.