Skip to content

drainStream

function drainStream(stream, model): Promise<Completion>;

Defined in: core/src/turn.ts:150

Drain a stream into a Completion: collectTurn, flattened for a caller that wants the answer rather than a message to append. model names the model unless a fallback provider stamped the one that answered.

Parameter Type
stream AsyncIterable<ProviderChunk>
model string

Promise<Completion>