# `Jev`

A small DSL for structured decisions from Jev providers.

Configure a provider and key in runtime config:

    config :jev,
      provider: :typesafe,
      api_key: System.fetch_env!("TYPESAFE_API_KEY")

Use `provider: :openrouter` with an OpenRouter API key to route the same
calls through OpenRouter's Decisions API.

`ask/2`, `choose/3`, `score/3`, and `analyze/3` return normalized answers.
They raise `Jev.Error` when configuration, transport, or response handling
fails. `ask?/2` returns a boolean and has the same error behavior.

# `analyze`

```elixir
@spec analyze(term(), map() | keyword(), keyword()) :: map()
```

Evaluates several typed questions against one state and returns a keyed map.

# `ask`

```elixir
@spec ask(String.t(), keyword()) :: {:yes | :no, float()}
```

Evaluates a yes/no question, returning `{:yes | :no, probability}`.

# `ask?`

```elixir
@spec ask?(String.t(), keyword()) :: boolean()
```

Evaluates a yes/no question and returns a boolean at the requested threshold.

# `choose`

```elixir
@spec choose(String.t(), list() | map(), keyword()) :: {term(), float()}
```

Chooses one value from the provided options, returning `{choice, probability}`.

# `score`

```elixir
@spec score(String.t(), list(), keyword()) :: {number(), float()}
```

Scores state on ordered levels, returning `{score, confidence}`.

---

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