Streams the events of source to response as Server-Sent Events while run (usually
() => agent.prompt(text)) is pending, then ends the response. A failure of run becomes an
error event. The agent keeps running if the client goes away; abort it explicitly.
Streams the events of
sourcetoresponseas Server-Sent Events whilerun(usually() => agent.prompt(text)) is pending, then ends the response. A failure ofrunbecomes anerrorevent. The agent keeps running if the client goes away; abort it explicitly.