# `Jidoka.Effect.LLMDecision`
[🔗](https://github.com/agentjido/jidoka/blob/v0.9.0/lib/jidoka/effect/llm_decision.ex#L1)

Typed model-side decision returned by an LLM effect.

The runtime uses a constrained decision protocol: a model either returns a
final response or asks Jidoka to run one or more operations. Keeping that
decision as a struct gives hibernate/resume a stable shape instead of relying
on loose maps.

# `decision_type`

```elixir
@type decision_type() :: :final | :operation | :operations
```

# `t`

```elixir
@type t() :: %Jidoka.Effect.LLMDecision{
  arguments: map(),
  content: nil | nil | binary(),
  metadata: map(),
  name: nil | nil | binary(),
  operations: [term()],
  parts: [term()],
  result: nil | nil | any(),
  type: (:final | :operation) | :operations
}
```

# `final`

```elixir
@spec final(
  String.t() | [Jidoka.ContentPart.input()],
  keyword()
) :: t()
```

Builds a final-answer model decision.

# `from_input`

```elixir
@spec from_input(t() | keyword() | map()) :: {:ok, t()} | {:error, term()}
```

Normalizes an existing decision, keyword list, or map.

# `new`

```elixir
@spec new(keyword() | map()) :: {:ok, t()} | {:error, term()}
```

Builds a model decision from keyword or map attributes.

# `new!`

```elixir
@spec new!(keyword() | map()) :: t()
```

Builds a model decision and raises if the attributes are invalid.

# `operation`

```elixir
@spec operation(String.t(), map(), keyword()) :: t()
```

Builds a decision that requests one operation.

# `operations`

```elixir
@spec operations(
  [Jidoka.Effect.OperationRequest.t() | keyword() | map()],
  keyword()
) :: t()
```

Builds a decision that requests one or more operations.

# `schema`

```elixir
@spec schema() :: Zoi.schema()
```

Returns the Zoi schema for a normalized model decision.

# `to_payload`

```elixir
@spec to_payload(t()) :: map()
```

Projects a model decision into its effect payload.

---

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