---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/litert_lm/helpers/functions/renderMediaToLiteRtContent.md
---

# Function: renderMediaToLiteRtContent()

```ts
function renderMediaToLiteRtContent(input: {
  media: Media;
  modalityEnabled: boolean;
  nonce: string;
  renderTrustedContent: (content: string, attrs: TrustedContentAttrs) => string;
  renderUntrustedContent: (
    content: string,
    attrs: UntrustedContentAttrs,
  ) => string;
  unsupportedMediaPolicy: UnsupportedMediaPolicy;
  warn?: (msg: string) => void;
}): Promise<MessageContentItem[]>;
```

Defined in: [src/batteries/llm/litert\_lm/helpers.ts:208](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/llm/litert_lm/helpers.ts#L208)

Render a media kind/mime/filename into a LiteRT content item, or fall back per
`unsupportedMediaPolicy`.

## Parameters

| Parameter                      | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input`                        | { `media`: [`Media`](../../../../../common/classes/Media.md); `modalityEnabled`: `boolean`; `nonce`: `string`; `renderTrustedContent`: (`content`: `string`, `attrs`: [`TrustedContentAttrs`](../../../../interfaces/TrustedContentAttrs.md)) => `string`; `renderUntrustedContent`: (`content`: `string`, `attrs`: [`UntrustedContentAttrs`](../../../../interfaces/UntrustedContentAttrs.md)) => `string`; `unsupportedMediaPolicy`: [`UnsupportedMediaPolicy`](../../../transformers_js/type-aliases/UnsupportedMediaPolicy.md); `warn?`: (`msg`: `string`) => `void`; } |
| `input.media`                  | [`Media`](../../../../../common/classes/Media.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `input.modalityEnabled`        | `boolean`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `input.nonce`                  | `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `input.renderTrustedContent`   | (`content`: `string`, `attrs`: [`TrustedContentAttrs`](../../../../interfaces/TrustedContentAttrs.md)) => `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `input.renderUntrustedContent` | (`content`: `string`, `attrs`: [`UntrustedContentAttrs`](../../../../interfaces/UntrustedContentAttrs.md)) => `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `input.unsupportedMediaPolicy` | [`UnsupportedMediaPolicy`](../../../transformers_js/type-aliases/UnsupportedMediaPolicy.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `input.warn?`                  | (`msg`: `string`) => `void`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

## Returns

`Promise`<`MessageContentItem`\[]>

## Remarks

The preview `.litertlm` models are text-in/text-out, and the exact multimodal content-item wire
shape is not yet stable in the published types. This maps image/audio/document/video to a
best-effort `{ type, path }`-style item when the matching modality flag is enabled, and otherwise
degrades through the shared `unsupportedMediaPolicy` (stash text / synthetic description / throw).
Verify the content-item shape against the installed `.d.ts` + a real multimodal model before
relying on the native path.
