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

    Drives a multi-turn OpenAI Chat Completions conversation with tool calling, executing the tool calls of each turn concurrently via ToolCallExecutor.

    This replaces the OpenAI SDK's chat.completions.runTools(...) runner, whose built-in tool loop executes tool calls strictly sequentially. By driving the raw chunk stream (chat.completions.create({ stream: true })) ourselves, multiple tool calls emitted in a single model turn (e.g. parallel agent delegations) run in parallel.

    Hierarchy (View Summary)

    Index
    done: boolean = false
    logger: ILogger
    messageCache: LanguageModelStreamResponsePart[] = ...
    messages: ChatCompletionMessageParam[]
    requestQueue: Deferred<IterResult>[] = ...
    streamCancellation: CancellationTokenSource = ...
    streamingRetry: OpenAiStreamingRetry
    terminalError: Error | undefined = undefined
    toDispose: DisposableCollection = ...
    toolCallExecutor: ToolCallExecutor
    • Aborts the active provider stream and immediately terminates the iterator, so a next() call pending on tool execution (which is only cooperatively cancelled via the token forwarded to handlers) settles promptly instead of stalling until an uninterruptible handler eventually finishes.

      Returns void

    • Streams a single completion, emitting text/tool-call parts and collecting the turn's tool calls.

      Returns Promise<{ assistantText: string; toolCalls: CollectedToolCall[] }>