Type Alias: MediaOutputExtractorFn
type MediaOutputExtractorFn = (
result: unknown,
) => GeneratedMediaOutput[] | Promise<GeneratedMediaOutput[]>;Defined in: src/batteries/llm/chat_common/types.ts:326
Extracts generated media from a battery's raw generation result so the adapter can surface it as assistant Message.attachments. Injectable + defaulted to absent (no media output) on every LLM battery, mirroring the toolCallParser / reasoningParser / decodeMedia injection seams.
Parameters
| Parameter | Type |
|---|---|
result | unknown |
Returns
| GeneratedMediaOutput[] | Promise<GeneratedMediaOutput[]>
Remarks
result is the battery-native generation object (transformers.js model.generate / pipeline output; the LiteRT-LM final Message + raw content items) — deliberately typed unknown because its shape is battery-specific and the extractor is supplied by whoever wraps a media-emitting model. Returning an empty array (or not supplying the hook) yields today's text-only behavior, byte-for-byte unchanged.