Interface GMIOutputExport

Represents the complete, non-chunked output of a GMI turn or significant processing step. This is typically the TReturn type of an AsyncGenerator yielding GMIOutputChunk.

Interface

GMIOutput

interface GMIOutput {
    isFinal: boolean;
    responseText?: null | string;
    toolCalls?: ToolCallRequest[];
    uiCommands?: UICommand[];
    audioOutput?: AudioOutputConfig;
    imageOutput?: ImageOutputConfig;
    usage?: CostAggregator;
    reasoningTrace?: ReasoningTraceEntry[];
    error?: {
        code: string;
        message: string;
        details?: any;
    };
    ragSources?: RagRetrievedChunk[];
    structuredOutput?: StructuredReplyOutput;
}

Properties

isFinal: boolean

false with toolCalls stops the turn for the host: the runtime saves the pending request, and the host runs those calls and passes their results back. Any other output, final or naming no calls, ends the turn, or the tool-result continuation, with FINAL_RESPONSE.

responseText?: null | string
toolCalls?: ToolCallRequest[]

On an output with isFinal: false, the calls the host runs: the runtime reads every one of them as a call that waits on the host, since a call carries no mode of its own, so a GMI leaves out of such an output the calls it ran itself. On a final output, the calls of the GMI's own tool rounds, each one run or refused by the tool-call gate: FINAL_RESPONSE.finalToolCalls lists them, and nothing waits on them.

uiCommands?: UICommand[]
audioOutput?: AudioOutputConfig
imageOutput?: ImageOutputConfig
reasoningTrace?: ReasoningTraceEntry[]
error?: {
    code: string;
    message: string;
    details?: any;
}

Type declaration

  • code: string
  • message: string
  • Optional details?: any
ragSources?: RagRetrievedChunk[]

Retrieved RAG chunks for the turn, populated when the GMI performed a RAG retrieval; a tool continuation retrieves nothing of its own and carries the chunks of the user turn it continues, when the same GMI ran that turn (a pause stores no retrieved chunk). Threaded into the FINAL_RESPONSE chunk so client code and the output-guardrail layer (Grounding Guard, Citation Verifier) can verify generated claims against the same sources the model saw.

structuredOutput?: StructuredReplyOutput

On a structured turn: the parsed value and its check (see api/runtime/structuredReply).