Skip to content

TaskOutput

TaskOutput = object

The normalized output of a run, shared by TaskResult and the completed and cancelled stream terminal outcomes (ADR 016). ‘type’ describes the content representation, not the task: ‘text’ carries inline text, ‘playback’ reports a managed, audible effect that has no retrievable bytes, and ‘artifact’ references retrievable media (ADR 017). A playback output is never an artifact, and an artifact output never implies that anything was played.

[property: string]: unknown

optional artifact?: MediaArtifact

The retrievable media the run produced. Required when type is ‘artifact’.


optional playback?: PlaybackOutput

Completion of managed playback. Required when type is ‘playback’. Carries no media.


optional preparation?: PreparationItem[]

What a prepare() run did, one item per provider and task. Required when type is ‘prepared’. One failed item does not fail the run.


optional speech?: SpeechOutput

The locale and voice a text-to-speech run actually used, so an unmet preference is visible without being an error.


optional text?: string

The text the run produced. Required when type is ‘text’.


type: TaskOutputType

The content representation: ‘text’, ‘playback’ or ‘artifact’. ‘prepared’ ends a prepare() run, carries no content, and lists each item in ‘preparation’.