# `Jido.Chat.MediaType`
[🔗](https://github.com/agentjido/jido_chat/blob/v1.2.0/lib/jido/chat/media_type.ex#L1)

Resolves media types without applying a provider-independent default.

Adapters should use evidence in this order:

1. A valid MIME value declared by the provider.
2. A default that the provider contract guarantees for the downloadable file.
3. A valid HTTP `Content-Type`, when it comes from the media download response.
4. A file signature, when the bytes have already been downloaded.
5. A filename or URL extension as a best-effort hint.

Pass the provider payload value as the first argument to `resolve/2`. Pass a
download response `Content-Type` as `:response_media_type`. A provider default
is never added unless the caller supplies `:provider_default`. Normalization
and MIME resolution do not change media bytes.

# `kind`

```elixir
@type kind() :: :image | :audio | :video | :file
```

# `from_filename`

```elixir
@spec from_filename(term()) :: String.t() | nil
```

Returns a MIME hint from a filename, path, or URL extension.

# `kind`

```elixir
@spec kind(term(), term()) :: kind()
```

Returns the canonical media kind from MIME data or a reference hint.

# `normalize`

```elixir
@spec normalize(term()) :: String.t() | nil
```

Returns a normalized MIME value or `nil` for blank and invalid values.

# `resolve`

```elixir
@spec resolve(
  term(),
  keyword()
) :: String.t() | nil
```

Resolves the best available MIME value.

Supported options are `:provider_default`, `:response_media_type`, `:data`,
`:filename`, `:url`, and `:path`. Filename and reference values are hints and
have the lowest priority.

# `sniff`

```elixir
@spec sniff(term()) :: String.t() | nil
```

Detects common binary formats from their file signatures.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
