Skip to content
1 min read · 287 words

Interface: RawMedia

Defined in: src/lib/classes/media.ts:100

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).src/lib/classes/media.ts:112
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.src/lib/classes/media.ts:106
kind"document" | "audio" | "image" | "video"The media kind. See MediaKind.src/lib/classes/media.ts:108
mimeTypestringThe MIME type of the underlying bytes.src/lib/classes/media.ts:110
modalityHazard"inert" | "extractable-instructions" | "opaque-perceptual"Modality hazard declared at construction time. Required — there is NO default. See MediaModalityHazard.src/lib/classes/media.ts:124
readerMediaReaderRe-openable byte source. See @nhtio/adk!MediaReader.src/lib/classes/media.ts:114
source?stringOptional provenance pointer (URL, tool name, etc.) for audit / events.src/lib/classes/media.ts:126
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 {}.src/lib/classes/media.ts:133
trustTier"first-party" | "third-party-public" | "third-party-private"Trust tier declared at construction time. Required — there is NO default. See MediaTrustTier.src/lib/classes/media.ts:119