followRun
function followRun(options): AsyncGenerator<ChatEvent>;Defined in: react/src/agents.ts:1823
The display events for one viewer of a stored run: what the live stream would have sent after the viewer’s cursor, then the saved run once the log ends.
It replays the run’s log from its first record through a fresh projector and sends only what comes after the cursor. At a gap in the log it sends the projector’s marker, then a snapshot of the saved run read then, while that run is still going in the last row. When the last row ends it sends that snapshot again, with the final state. A viewer already past the end still gets it, unnumbered, so its client knows the host answered.
for await (const event of followRun({ projector, segments, cursor, read, conversation })) write(`data: ${JSON.stringify(event)}\n\n`);Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
FollowRunOptions |
Returns
Section titled “Returns”AsyncGenerator<ChatEvent>