Skip to main content

Module ws

Module ws 

Source
Expand description

WebSocket Client

This module provides a client for consuming AG-UI events via WebSocket.

§Example

use ag_ui_client::WsClient;
use futures::StreamExt;

let client = WsClient::connect("ws://localhost:3000/ws").await?;
let mut stream = client.into_stream();

while let Some(event) = stream.next().await {
    println!("Event: {:?}", event?.event_type());
}

Structs§

WsClient
WebSocket client for consuming AG-UI event streams.
WsConfig
Configuration for WebSocket client connections.
WsEventStream
A stream of AG-UI events from a WebSocket connection.