MingaAgent.ModelSelection (Minga v0.1.0)

Copy Markdown View Source

Immutable authority for one executable native model selection.

Persisted values decode into Stored, which deliberately has no ReqLLM model. A selection becomes active only after its exact route has been validated and materialized into one inline LLMDB.Model.

Summary

Functions

Constructs the only valid form of a newly active selection.

Returns a human-readable, secret-free credential identity.

Decodes and validates persisted data without making it executable.

Encodes an active selection without runtime modules, models, paths, or secrets.

Returns an opaque stable hash of the exact route and credential identity.

Composes image-input and tool-result transport support for the exact selection.

Returns true only when image input is explicitly supported.

Materializes a decoded stored selection against its declared Minga backend.

Returns true only when the exact route explicitly supports images in tool results.

Returns true only when tool use is explicitly supported.

Returns the persistence codec version.

Changes reasoning effort while preserving the immutable executable route.

Types

capability()

credential_ref()

image_tool_result_delivery()

@type image_tool_result_delivery() ::
  :supported | {:unsupported, :model_image_input | :tool_result_transport}

t()

@type t() :: %MingaAgent.ModelSelection{
  backend_id: String.t(),
  backend_module: module(),
  credential: credential_ref(),
  evidence: MingaAgent.ModelSelection.Evidence.t(),
  policy: MingaAgent.ModelSelection.Policy.t(),
  request_model: LLMDB.Model.t(),
  route: MingaAgent.ModelSelection.Route.t()
}

Functions

build(provider_spec, route, credential, policy, evidence)

Constructs the only valid form of a newly active selection.

credential_id(arg1)

@spec credential_id(credential_ref()) :: String.t()

Returns a human-readable, secret-free credential identity.

decode(data)

@spec decode(map()) :: {:ok, MingaAgent.ModelSelection.Stored.t()} | {:error, term()}

Decodes and validates persisted data without making it executable.

encode(selection)

@spec encode(t()) :: map()

Encodes an active selection without runtime modules, models, paths, or secrets.

id(map)

Returns an opaque stable hash of the exact route and credential identity.

image_tool_result_delivery(selection)

@spec image_tool_result_delivery(t()) :: image_tool_result_delivery()

Composes image-input and tool-result transport support for the exact selection.

images?(model_selection)

@spec images?(t()) :: boolean()

Returns true only when image input is explicitly supported.

materialize(stored, provider_spec)

@spec materialize(MingaAgent.ModelSelection.Stored.t(), map()) ::
  {:ok, t()} | {:error, term()}

Materializes a decoded stored selection against its declared Minga backend.

tool_result_images?(model_selection)

@spec tool_result_images?(t()) :: boolean()

Returns true only when the exact route explicitly supports images in tool results.

tools?(model_selection)

@spec tools?(t()) :: boolean()

Returns true only when tool use is explicitly supported.

version()

@spec version() :: pos_integer()

Returns the persistence codec version.

with_reasoning(selection, effort)

@spec with_reasoning(t(), String.t()) :: {:ok, t()} | {:error, String.t()}

Changes reasoning effort while preserving the immutable executable route.