Skip to main content

Module bridge

Module bridge 

Source
Expand description

Event Bridge - Converts agent events to AG-UI protocol events.

This module provides the EventBridge which is the main integration point between the syncable-cli agent and the AG-UI protocol.

§Usage

let bridge = server.event_bridge();

// Start a run
bridge.start_run().await;

// Emit text message events
bridge.start_message().await;
bridge.emit_text_chunk("Hello, ").await;
bridge.emit_text_chunk("world!").await;
bridge.end_message().await;

// Emit tool call events
let tool_id = bridge.start_tool_call("analyze", &args).await;
bridge.emit_tool_args_chunk(&tool_id, "partial args").await;
bridge.end_tool_call(&tool_id).await;

// Finish the run
bridge.finish_run().await;

Structs§

EventBridge
Bridge between agent code and AG-UI protocol events.