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

A call the model asked for.

`raw_arguments` is the lossless wire projection. When it is present,
`arguments` is its decoded value; when decoding fails, `arguments` is `nil` and
`arguments_error` explains why. `id` is `nil` for providers that identify a
call by name only.

# `arguments`

```elixir
@type arguments() :: map() | nil
```

# `arguments_error`

```elixir
@type arguments_error() :: nil | {:invalid_json, String.t()} | :no_json_decoder
```

Why `arguments` is `nil`.

`raw_arguments` always carries the payload itself, so this field only says
what went wrong: `{:invalid_json, reason}` when the payload is not decodable
JSON (or not an object), and `:no_json_decoder` when
`LlmCall.StreamAssembler` was built without a `json_decoder:`.

# `t`

```elixir
@type t() :: %LlmCall.ToolCall{
  arguments: arguments(),
  arguments_error: arguments_error(),
  id: String.t() | nil,
  index: non_neg_integer() | nil,
  name: String.t() | nil,
  raw_arguments: String.t() | nil
}
```

---

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