Synaptic.Jev (synaptic v0.3.0-alpha.13)

View Source

Native TypeSafe Jev client for typed judgments over shared state.

Send all independent questions about the same state in one evaluate/3 call. Jev does not generate text, invoke tools, or manage workflow policy. Low confidence is a successful answer; callers decide whether to act or escalate.

questions = %{
  "intent" => Synaptic.Jev.choice("What does `message` request?", %{
    "billing" => "Help with charges or invoices",
    "other" => "Anything else"
  }),
  "refund" => Synaptic.Jev.noul("Does `message` explicitly request a refund?")
}

Synaptic.Jev.evaluate(%{message: "Please refund this charge."}, questions)

Configure :synaptic, Synaptic.Jev or pass per-call options. Credentials default to TYPESAFE_API_KEY; the model defaults to the pinned jev-1.13.0.

Options: :api_key, :model, :endpoint, :finch, :timeout (total HTTP budget, default 30,000 ms), :receive_timeout (15,000 ms), :pool_timeout (5,000 ms), and :max_retries (2 additional attempts). Retries cover transient transport failures and HTTP 408/429/500/502/503/504/529, with bounded backoff and Retry-After support. Workflow retries are a separate, outer budget.

The :judgment security profile surface supports :privacy, :sanitization, :security_policy, :egress (surface :jev), :connector_gateway, and :audit. Supply :run_id, :step_name, and :tenant outside workflow steps; inside steps they are inherited. Chat-specific options are rejected.

Telemetry uses [:synaptic, :jev, :start | :stop | :exception] and excludes input content and answers. Returned usage remains in TypeSafe's native terms.

Summary

Functions

Defines a Choice over named options and their descriptions.

Defines a yes/no judgment, optionally with true/false criteria.

Defines a Score over two to ten ordered descriptive levels.

Functions

choice(instructions, criteria)

Defines a Choice over named options and their descriptions.

evaluate(state, questions, opts \\ [])

@spec evaluate(term(), map(), keyword()) ::
  {:ok, Synaptic.Jev.Result.t()} | {:error, term()}

noul(instructions, criteria \\ nil)

Defines a yes/no judgment, optionally with true/false criteria.

score(instructions, criteria)

Defines a Score over two to ten ordered descriptive levels.