Provider execution result tagged by response kind.
Providers return this struct from native and compatibility calls so routing,
fallback, HTTP route rendering, and token accounting can branch on an explicit
:kind instead of inferring meaning from nullable fields.
Summary
Types
@type kind() :: :response | :stream | :error
@type t() :: %LLMProxy.Providers.Result{ error: String.t() | nil, kind: kind(), model: String.t() | nil, provider: module() | nil, provider_body: term() | nil, provider_name: String.t() | nil, response: map() | nil, retry_after_ms: non_neg_integer() | nil, status: pos_integer() | nil, stream: Enumerable.t() | nil, token: token() }
@type token() :: map() | nil
Functions
@spec error(String.t(), pos_integer(), token(), keyword()) :: t()
@spec stream(Enumerable.t(), token()) :: t()
@spec with_attempt({:ok, t()} | {:error, t()}, LLMProxy.Providers.Attempt.t()) :: {:ok, t()} | {:error, t()}