Expand description
A transport that replays a scripted list of events.
Testing a client against a live agent is slow, flaky, and needs a model. It
is also unnecessary: the agent’s half of the conversation is just a list of
events. ReplayTransport serves one — and records the
RunAgentInputs it was handed, which is how a test asserts that a resume
carried the right answers.
The script is typed, but it stands in for a remote agent, so each event is
serialized and read back through the compatibility boundary
(TransportStream::enforced): a test sees what a client makes of the
bytes, warnings included.
use ag_ui::client::transport::ReplayTransport;
use ag_ui::Event;
let transport = ReplayTransport::new([
Event::run_started("thread-1", "run-1"),
Event::run_finished_success("thread-1", "run-1"),
]);Structs§
- Replay
Transport - A
Transportthat answers each run from a script.