Skip to content
1 min read · 212 words

Interface: GeneratedMediaOutput

Defined in: src/batteries/llm/chat_common/types.ts:302

One piece of media a model GENERATED as turn output — the descriptor a MediaOutputExtractorFn returns for the adapter to persist + attach to the assistant @nhtio/adk!Message.

Remarks

The LLM batteries are multimodal-IN, text-OUT by default: the tested open-weight chat checkpoints emit only text, so no media output is produced unless a consumer wraps a media-emitting model AND supplies an extractor. The framework contract already supports the output direction — Message.attachments is symmetric across roles and ctx.storeMediaBytes persists generated bytes — so this descriptor is all the adapter needs: it calls storeMediaBytes with bytes, builds a Media.toolGenerated({ kind, mimeType, filename, reader }) from the returned reader, and attaches it.

Properties

PropertyTypeDescriptionDefined in
bytesUint8ArrayThe generated media bytes.src/batteries/llm/chat_common/types.ts:308
filename?stringOptional filename for the attachment; the adapter supplies a default when omitted.src/batteries/llm/chat_common/types.ts:310
kind"document" | "audio" | "image" | "video"Media modality ('image'/'audio'/'video'/'document').src/batteries/llm/chat_common/types.ts:304
mimeTypestringConcrete MIME type of the generated bytes (e.g. 'audio/wav', 'image/png').src/batteries/llm/chat_common/types.ts:306