Behaviour implemented by inference adapter modules.
Direct provider adapters use the default :explicit credential mode. A
managed authority adapter must explicitly report :managed_materialization
and owns lease redemption and transient provider material outside this
package.
Summary
Callbacks
Reports what this adapter can do for the given client's provider binding.
Functions
Resolves the capabilities of a configured client.
Reports an adapter's credential mode; existing direct adapters are explicit.
Returns the closed set of credential modes.
Returns the closed set of valid provider kinds.
Reports whether a value belongs to the closed provider-kind set.
Types
Callbacks
@callback capabilities(Inference.Client.t()) :: [Inference.Capability.t()]
Reports what this adapter can do for the given client's provider binding.
Adapters that can answer capability questions implement this callback; the answer must come from a real provider feature declaration, never a guess.
@callback complete(Inference.Client.t(), Inference.Request.t()) :: {:ok, Inference.Response.t()} | {:error, Inference.Error.t()}
@callback credential_mode() :: credential_mode()
@callback provider_kind() :: provider_kind()
@callback stream(Inference.Client.t(), Inference.Request.t()) :: {:ok, Enumerable.t()} | {:error, Inference.Error.t()}
Functions
@spec capabilities(Inference.Client.t()) :: [Inference.Capability.t()]
Resolves the capabilities of a configured client.
Adapters that implement capabilities/1 answer for their provider binding.
Adapters that do not fall back to the client's declared capabilities.
@spec credential_mode(module()) :: credential_mode() | :invalid
Reports an adapter's credential mode; existing direct adapters are explicit.
@spec credential_modes() :: [credential_mode()]
Returns the closed set of credential modes.
@spec provider_kinds() :: [provider_kind()]
Returns the closed set of valid provider kinds.
Reports whether a value belongs to the closed provider-kind set.