---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/transformers_js/type-aliases/UnsupportedMediaPolicy.md
description: >-
  Policy for how a Chat-family battery handles a {@link @nhtio/adk!Media}
  instance whose modality the wire protocol cannot natively represent.
---

# Type Alias: UnsupportedMediaPolicy

```ts
type UnsupportedMediaPolicy =
  | "throw"
  | "fallback-stash"
  | "synthetic-description"
  | {
      mode: "fallback-stash";
      stashKeys: ReadonlyArray<string>;
    };
```

Defined in: [src/batteries/llm/chat\_common/types.ts:283](https://github.com/NHTIO/ADK/blob/v1.20261103.0/src/src/batteries/llm/chat_common/types.ts#L283)

Policy for how a Chat-family battery handles a [@nhtio/adk!Media](../../../../common/classes/Media.md) instance whose modality the
wire protocol cannot natively represent.

## Remarks

The option SHAPE is shared; each battery decides which modalities count as "unsupported"
(OpenAI Chat Completions: video; Ollama native `/api/chat`: everything except image). Three
modes:

* `'throw'` — raise the battery's unsupported-media exception and fail the dispatch. Loud
  failure; the default, so a misconfigured pipeline surfaces immediately.
* `'fallback-stash'` — look for a model-readable text entry in `media.stash`. If present, render
  that text inside the appropriate trust envelope in lieu of a media block. If no entry is found,
  fall through to `'synthetic-description'` behaviour. The shorthand string form uses the
  battery's default key list (`['text:transcript', 'text:caption', 'text:description']`, walked
  in order). The object form `{ mode: 'fallback-stash'; stashKeys }` overrides the key list.
* `'synthetic-description'` — always render a synthetic text description constructed from
  `filename`, `byteLength`, and `mimeType` regardless of `stash` presence.
