Skip to main content

Interface: IAnswerResponse<TStructured>

Defined in: types.ts:605

A finished answer: the text, the structured value when a schema was given, what it was grounded on, its warnings and its cost.

The response of ask(), of a run() the model finished and of a resume() that finished the run; the host renders it and keeps threadId for the next call.

Type Parameters​

TStructured​

TStructured = unknown

Properties​

citations​

citations: string[]

Defined in: types.ts:615

The ids of the knowledge-base chunks the model was given, not of the ones the answer rests on.


debug?​

optional debug?: IAnswerDebug

Defined in: types.ts:632

The model-side transcript of the call; present when the input had debug: true.


endedByTool?​

optional endedByTool?: string

Defined in: types.ts:630

Name of the tool that ended the run (D86), when a tool did.

Lets the UI tell "the assistant handed over / placed the order and closed" from "the assistant answered".

Set when a tool with endsRun ran: the text is the model's closing sentence after that tool. Absent on ask() and on a run the model ended by answering.

Example​

"handover_to_agent" - the UI switches the thread to the human agent's queue

issues​

issues: IIssue[]

Defined in: types.ts:617

The WARNING issues of the call (guardrails, a refused later step, the assembler), for the UI to flag.


kind​

kind: ANSWER

Defined in: types.ts:607

The discriminant of TGatewayResponse.


structured?​

optional structured?: TStructured

Defined in: types.ts:613

The parsed, schema-checked answer; present when the input had an outputSchema.


text​

text: string

Defined in: types.ts:611

The answer as the model wrote it, in the call's outputFormat; with an outputSchema, the raw text structured was parsed from.


threadId​

threadId: string

Defined in: types.ts:609

The thread the turns were stored in: the one the call named, or the one it created.


usage​

usage: IUsage

Defined in: types.ts:619

Tokens of the call; for a run, the sum over its steps.