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

    Interface for ChatResponseContent parts that require user interaction. Content parts that implement this interface can be tracked by the delegation renderer without content-type-specific checks.

    interface ToolCallChatResponseContent {
        arguments?: string;
        confirmationTimeout?: number;
        confirmed: Promise<boolean>;
        data?: Record<string, string>;
        finished: boolean;
        id?: string;
        interactionId: undefined | string;
        isResolved: boolean;
        kind: "toolCall";
        name?: string;
        needsUserConfirmation: Promise<void>;
        result?: ToolCallResult;
        whenFinished: Promise<void>;
        whenResolved: Promise<void>;
        asDisplayString(): undefined | string;
        asString(): undefined | string;
        cancelConfirmation(reason?: unknown): void;
        complete(result: ToolCallResult): void;
        confirm(): void;
        deny(reason?: string): void;
        merge(nextChatResponseContent: ChatResponseContent): boolean;
        requestUserConfirmation(): void;
        toLanguageModelMessage(): LanguageModelMessage | LanguageModelMessage[];
        toSerializable(): SerializableChatResponseContentData;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    arguments?: string
    confirmationTimeout?: number

    Timeout in seconds for confirmation dialogs. 0 means no timeout.

    confirmed: Promise<boolean>
    data?: Record<string, string>
    finished: boolean
    id?: string
    interactionId: undefined | string

    Stable identifier for deduplication in pending interaction tracking.

    isResolved: boolean

    Whether the interaction has been resolved (e.g., confirmed/denied, option selected).

    kind: "toolCall"
    name?: string
    needsUserConfirmation: Promise<void>

    Resolves when the tool call requires user confirmation (show Allow/Deny UI).

    whenFinished: Promise<void>
    whenResolved: Promise<void>

    Resolves when the interaction is resolved. Used for cleanup in delegation chains.

    Methods

    • Represents the content as a string. Returns undefined if the content is purely informational and/or visual and should not be included in the overall representation of the response.

      Returns undefined | string

    • Mark the tool call as completed with the given result.

      This is used to update the UI immediately when a tool finishes execution, without waiting for all parallel tool calls to complete. The language model batches tool results (via Promise.all) before yielding them to the stream, so without this early completion signal, the UI wouldn't update until all tools finish. The values set here will be overwritten by merge() when the language model eventually yields the results, but they should be identical.

      Parameters

      Returns void

    • Signal that this tool call needs user confirmation. Resolves the needsUserConfirmation promise.

      Returns void