Theia API Documentation v1.77.0
    Preparing search index...

    Base class for async iterators that deliver LanguageModelStreamResponseParts produced asynchronously from some upstream source. It implements the producer/consumer queue: subclasses push parts via handleIncoming as they arrive and signal completion by setting terminalError (for failures) and/or calling dispose. Parts produced before the consumer asks for them are buffered, and requests made before parts are available are queued.

    Hierarchy (View Summary)

    Implements

    Index
    done: boolean = false
    messageCache: LanguageModelStreamResponsePart[] = ...
    requestQueue: Deferred<IterResult>[] = ...
    terminalError: Error | undefined = undefined
    toDispose: DisposableCollection = ...
    • Terminates the iteration when the consumer abandons it, be it by breaking out of a for await loop or by that loop exiting with an error. Without this, the producer would keep requesting completions, executing tool calls and buffering parts that nobody will ever read.

      Returns Promise<IterResult>