Saltar al contenido principal
Versión: 0.17.0

Function: createInputQueue()

function createInputQueue(options?): object;

Defined in: core/session.ts:340

User message queue backed by a single long-lived generator, for any multi-turn (chat-shaped) caller of query().

The SDK closes the transport as soon as the AsyncIterable passed as prompt (or to streamInput()) finishes iterating — so a "one message and done" generator leaves the transport closed right after sending that message, and the next call blows up with "ProcessTransport is not ready for writing". A real multi-turn conversation needs a single generator that never finishes on its own: messages get pushed into it with push() and it's only explicitly closed with end() when leaving the chat.

With modeControl, each message goes after the note on a plan-mode switch the model hasn't been told about yet (ModeControl.takeNotice()).

Parameters​

ParameterType
options{ modeControl?: ModeControl; }
options.modeControl?ModeControl

Returns​

object

NameTypeDefined in
end()() => voidcore/session.ts:342
iterableAsyncIterable<SDKUserMessage>core/session.ts:343
push()(text) => voidcore/session.ts:341