# `LlmCore.Structured.JsonMode`
[🔗](https://github.com/fosferon/llm_core/blob/v0.3.0/lib/llm_core/structured/json_mode.ex#L1)

Helpers for working with providers that support JSON-mode outputs.

The helpers exposed here are intentionally lightweight so they can be used
from providers, pipelines, and tests without introducing new dependencies.

# `decoded`

```elixir
@type decoded() :: map() | list()
```

# `decode`

```elixir
@spec decode(LlmCore.LLM.Response.t() | binary() | decoded()) ::
  {:ok, decoded()} | {:error, term()}
```

Decodes the response content into a map/list.

When the content is already a map or list (for example, the provider returns
parsed JSON), it is returned as-is.

# `enforce`

```elixir
@spec enforce(keyword()) :: keyword()
```

Ensures the options passed to a provider request include JSON formatting.

Providers that already set `:format` or `:response_format` are left untouched.

---

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