Wraps a streaming async provider call (AsyncIterable) with request-scoped context metadata.
This helper:
Designed for streaming chat, image generation, or any provider API that emits incremental results.
The input payload type sent to the provider
The output payload type for each streamed chunk
Unified AI request containing input, options, and optional context
Provider streaming execution function to wrap
An AsyncGenerator emitting AIResponseChunk objects with metadata attached
Wraps a streaming async provider call (AsyncIterable) with request-scoped context metadata.
This helper:
Designed for streaming chat, image generation, or any provider API that emits incremental results.