# `LlmCall.Config`
[🔗](https://github.com/gilbertwong96/llm_call/blob/main/lib/llm_call/config.ex#L1)

Codec defaults and capture policy.

Holds no credentials and no base URL: those belong to the transport.
`default_provider_options` is merged before a request's `provider_options`
(completion or media), and the request wins per key.

`json` and `capture_raw` have compile-time defaults:

    config :llm_call,
      json_library: Torque,
      capture_raw: :all

Both are read with `Application.compile_env/3`, so changing them recompiles
the library; a `%LlmCall.Config{}` built with `new/1` overrides them per
client without touching the compiled default.

# `t`

```elixir
@type t() :: %LlmCall.Config{
  capture_raw: LlmCall.capture_raw(),
  default_provider_options: map(),
  json: module()
}
```

# `deep_merge`

```elixir
@spec deep_merge(map(), map()) :: map()
```

Deep-merges native provider options over a canonical body.

Nested maps merge recursively, so a native `generationConfig` keeps the
canonical `temperature`. Lists and scalars from the native side replace the
canonical value.

# `new`

```elixir
@spec new(keyword()) :: t()
```

Builds a config from the compile-time defaults.

`json_library:` and `capture_raw:` override the compiled defaults per config.
The JSON default is Elixir's built-in `JSON`; any module exposing either
tagged `encode/1`/`decode/1` (Torque, Jason, Poison) or bang
`encode!/1`/`decode!/1` (Elixir `JSON`) can be configured, and `LlmCall.JSON`
normalizes both to tagged tuples. The capture default is `:none`.

# `provider_options`

```elixir
@spec provider_options(LlmCall.Request.t() | LlmCall.Media.Request.t(), t()) :: map()
```

Merged provider options for a request, keyed by provider namespace.

Namespaces present in both the config and the request are merged recursively,
with the request value winning per key, so a nested native object keeps the
config keys the request does not repeat.

---

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