Skip to content

taskResultSchema

const taskResultSchema: object

The JSON Schemas those models were generated from, for runtime use.

readonly $id: "https://schemas.inderun.dev/1.0/task-result.schema.json"

readonly $schema: "https://json-schema.org/draft/2020-12/schema"

readonly additionalProperties: true

readonly description: "The response payload for a completed run() execution, for every task kind; output.type tells the content representation apart (text, managed playback, retrievable artifact). A full execution failure (validation, routing, or every attempted provider failing) is surfaced by run() throwing an IndeRunError instead of returning a TaskResult; finishReason and telemetry.errorClass are reserved for a provider reporting a non-fatal, degraded outcome on an otherwise-successful result (finishReason 'error' is produced by the Android ML Kit GenAI provider; telemetry.errorClass is not currently set by any provider in this codebase)."

readonly properties: object

readonly finishReason: object

readonly description: "How generation ended: 'stop' (natural end), 'length' (hit maxOutputTokens), or 'cancelled'. 'error' is reserved for a provider reporting a non-fatal issue on an otherwise-returned result — the Android ML Kit GenAI provider produces it when Gemini Nano reports a finish reason that is neither a natural stop nor the token limit. A full execution failure is instead surfaced by run() throwing an IndeRunError."

readonly enum: readonly ["stop", "length", "cancelled", "error"]

readonly output: object

readonly $ref: "task-output.schema.json"

readonly description: "The normalized output of the selected provider. See task-output.schema.json."

readonly provenance: object

readonly $ref: "execution-provenance.schema.json"

readonly description: "Normalized execution provenance: which target ran, its declared locality, the configured and reported model, and how fallback and routing played out. See execution-provenance.schema.json."

readonly runId: object

readonly description: "A unique, opaque identifier assigned by the engine for this specific execution attempt."

readonly minLength: 1

readonly type: "string"

readonly schemaVersion: object

readonly const: "1.0"

readonly description: "Contract schema version used to interpret the result payload."

readonly telemetry: object

readonly additionalProperties: true

readonly description: "Required metadata providing an overview of the execution result and performance metrics."

readonly properties: object

properties.telemetry.properties.errorClass

Section titled “properties.telemetry.properties.errorClass”

readonly errorClass: object

properties.telemetry.properties.errorClass.description

Section titled “properties.telemetry.properties.errorClass.description”

readonly description: "Present only if a provider reports a degraded outcome on an otherwise-successful result; no provider in this codebase currently sets this. Distinct from run() throwing — a thrown IndeRunError never produces a TaskResult at all."

properties.telemetry.properties.errorClass.enum

Section titled “properties.telemetry.properties.errorClass.enum”

readonly enum: readonly ["CapabilityMismatch", "Offline", "AuthError", "RateLimited", "Timeout", "Unavailable", "Internal"]

properties.telemetry.properties.providerUsed

Section titled “properties.telemetry.properties.providerUsed”

readonly providerUsed: object

properties.telemetry.properties.providerUsed.description

Section titled “properties.telemetry.properties.providerUsed.description”

readonly description: "The identifier for the specific provider that handled the request (e.g., 'openai_compatible_cloud')."

properties.telemetry.properties.providerUsed.minLength

Section titled “properties.telemetry.properties.providerUsed.minLength”

readonly minLength: 1

properties.telemetry.properties.providerUsed.type

Section titled “properties.telemetry.properties.providerUsed.type”

readonly type: "string"

properties.telemetry.properties.reportedModel

Section titled “properties.telemetry.properties.reportedModel”

readonly reportedModel: object

properties.telemetry.properties.reportedModel.description

Section titled “properties.telemetry.properties.reportedModel.description”

readonly description: "The model identifier the provider reported in its own response, set by the provider when its backend reports one. The engine carries it into provenance.reportedModel; it is never inferred from configuration."

properties.telemetry.properties.reportedModel.minLength

Section titled “properties.telemetry.properties.reportedModel.minLength”

readonly minLength: 1

properties.telemetry.properties.reportedModel.type

Section titled “properties.telemetry.properties.reportedModel.type”

readonly type: "string"

readonly totalMs: object

properties.telemetry.properties.totalMs.description

Section titled “properties.telemetry.properties.totalMs.description”

readonly description: "Measured execution duration in milliseconds, including route selection and result processing."

properties.telemetry.properties.totalMs.minimum

Section titled “properties.telemetry.properties.totalMs.minimum”

readonly minimum: 0

properties.telemetry.properties.totalMs.type

Section titled “properties.telemetry.properties.totalMs.type”

readonly type: "number"

readonly required: readonly ["providerUsed", "totalMs"]

readonly type: "object"

readonly usage: object

readonly additionalProperties: true

readonly description: "Optional metadata regarding the quantity of tokens processed by the provider."

readonly properties: object

readonly inputTokens: object

properties.usage.properties.inputTokens.description

Section titled “properties.usage.properties.inputTokens.description”

readonly description: "Number of input tokens consumed, as reported by the provider."

properties.usage.properties.inputTokens.minimum

Section titled “properties.usage.properties.inputTokens.minimum”

readonly minimum: 0

properties.usage.properties.inputTokens.type

Section titled “properties.usage.properties.inputTokens.type”

readonly type: "integer"

readonly outputTokens: object

properties.usage.properties.outputTokens.description

Section titled “properties.usage.properties.outputTokens.description”

readonly description: "Number of output tokens generated, as reported by the provider."

properties.usage.properties.outputTokens.minimum

Section titled “properties.usage.properties.outputTokens.minimum”

readonly minimum: 0

properties.usage.properties.outputTokens.type

Section titled “properties.usage.properties.outputTokens.type”

readonly type: "integer"

readonly totalTokens: object

properties.usage.properties.totalTokens.description

Section titled “properties.usage.properties.totalTokens.description”

readonly description: "Aggregated token count for this request, as reported by the provider."

properties.usage.properties.totalTokens.minimum

Section titled “properties.usage.properties.totalTokens.minimum”

readonly minimum: 0

properties.usage.properties.totalTokens.type

Section titled “properties.usage.properties.totalTokens.type”

readonly type: "integer"

readonly type: "object"

readonly required: readonly ["schemaVersion", "runId", "output", "finishReason", "telemetry"]

readonly title: "TaskResult"

readonly type: "object"