DummyLiveStep

One scripted step that a DummyLiveConnection runs when receive() is collected.

Inheritors

Types

Link copied to clipboard
class AwaitSent(val description: String, val matches: (Any) -> Boolean) : DummyLiveStep

Pauses receive() until the code under test sends a message that matches accepts, such as a tool response. Each sent message is checked once, in send order, so a message one wait skips cannot satisfy a later one. Fails the test if nothing matches within 5 seconds (test time under runTest); closing the connection ends the wait without failing.

Link copied to clipboard
data object EndStream : DummyLiveStep

Ends the stream so this and every later receive() completes without emitting more items.

Link copied to clipboard
data class Fail(val cause: Throwable) : DummyLiveStep

Makes this and every later receive() throw cause to test connection failures.

Link copied to clipboard
data class Respond(val response: LlmResponse) : DummyLiveStep

Emits response from receive(). If response.turnComplete is true, receive() finishes so the next receive() starts at the following step.