Skip to main content

WebSocketObserver

Trait WebSocketObserver 

Source
pub trait WebSocketObserver: Send + Sync {
    // Required method
    fn response<'a>(
        &'a self,
        provider: &'a str,
        credential: &'a Credential,
        model: &'a str,
        payload: &'a [u8],
    ) -> BoxFuture<'a, ()>;
}
Expand description

Receives the upstream WebSocket frames Go’s executors pass to helps.EmitWebSocketResponseEvent (the Codex and xAI WebSockets).

Required Methods§

Source

fn response<'a>( &'a self, provider: &'a str, credential: &'a Credential, model: &'a str, payload: &'a [u8], ) -> BoxFuture<'a, ()>

One non-empty upstream frame as the executor read it, on credential for the upstream model; provider is the executor identifier. The executor awaits the returned future before it handles the frame, as Go calls the observer inside its read loop.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§