nat.front_ends.fastapi.intermediate_steps_subscriber#

Attributes#

Functions#

pull_intermediate(_q, adapter)

Subscribes to the runner's event stream (which is now a simplified Observable)

pull_intermediate_atif(_q, converter)

Subscribe to the IntermediateStep stream and convert to ATIF on-the-fly.

Module Contents#

logger#
async pull_intermediate(_q, adapter)#

Subscribes to the runner’s event stream (which is now a simplified Observable) using direct callbacks. Processes each event with the adapter and enqueues results to _q.

async pull_intermediate_atif(
_q,
converter: nat.utils.atif_converter.ATIFStreamConverter,
)#

Subscribe to the IntermediateStep stream and convert to ATIF on-the-fly.

Each time the converter flushes a complete ATIF step it is enqueued as a ResponseATIFStep. When the stream completes, any pending turn is flushed and a ResponseATIFTrajectory summary is emitted.