Inference.Client (inference v0.3.0)

Copy Markdown View Source

Adapter client configuration.

Summary

Functions

Builds a client that additionally admits :agent_session adapters.

Builds an agent-session-admitting client or raises when invalid.

Validates that the configured adapter reports an explicitly admitted kind.

Types

t()

@type t() :: %Inference.Client{
  adapter: module(),
  adapter_opts: keyword(),
  admitted_kinds: [Inference.Adapter.provider_kind()],
  authority: map() | nil,
  backend: atom() | nil,
  capabilities: list(),
  defaults: keyword(),
  metadata: map(),
  model: String.t() | nil,
  provider: atom() | nil
}

Functions

agent_session(attrs)

@spec agent_session(keyword() | map()) :: {:ok, t()} | {:error, Inference.Error.t()}

Builds a client that additionally admits :agent_session adapters.

The default admitted-kind set deliberately excludes :agent_session so an agent-session runtime is never silently flattened into a completion endpoint. This is the explicit, per-client opt-in; it widens one client, never the default.

agent_session!(attrs)

@spec agent_session!(keyword() | map()) :: t()

Builds an agent-session-admitting client or raises when invalid.

new(attrs)

@spec new(keyword() | map()) :: {:ok, t()} | {:error, Inference.Error.t()}

new!(attrs)

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

validate_adapter_kind(client)

@spec validate_adapter_kind(t()) :: :ok | {:error, Inference.Error.t()}

Validates that the configured adapter reports an explicitly admitted kind.