Skip to content
1 min read · 287 words

Interface: RawMedia

Defined in: lib/classes/media.ts:91

Plain input object supplied to Media at construction time.

Remarks

Validated against rawMediaSchema before the Media instance is created.

Properties

PropertyTypeDescriptionDefined in
filenamestringFilename used by providers that key on it (e.g. OpenAI file.filename).lib/classes/media.ts:103
id?stringStable unique identifier for this media instance. Required for strict symmetry with Message.id and ToolCall.id. When omitted, a fresh UUIDv6 is assigned at construction time.lib/classes/media.ts:97
kind"audio" | "document" | "image" | "video"The media kind. See MediaKind.lib/classes/media.ts:99
mimeTypestringThe MIME type of the underlying bytes.lib/classes/media.ts:101
modalityHazard"inert" | "extractable-instructions" | "opaque-perceptual"Modality hazard declared at construction time. Required — there is NO default. See MediaModalityHazard.lib/classes/media.ts:115
readerMediaReaderRe-openable byte source. See @nhtio/adk!MediaReader.lib/classes/media.ts:105
source?stringOptional provenance pointer (URL, tool name, etc.) for audit / events.lib/classes/media.ts:117
stash?Record<string, MediaStashEntry>Free-form per-instance metadata register. Middleware pipelines append to this — typically with a text description, transcript, caption, or alt-text — so downstream code that cannot consume the media natively has a model-readable fallback. No keys are reserved by the framework. Defaults to {}.lib/classes/media.ts:124
trustTier"first-party" | "third-party-public" | "third-party-private"Trust tier declared at construction time. Required — there is NO default. See MediaTrustTier.lib/classes/media.ts:110