MingaAgent.Provider.Spec (Minga v0.1.0)

Copy Markdown View Source

Pure provider declaration metadata.

A provider spec describes a provider implementation without owning credentials, sessions, retries, events, or cleanup. Runtime enable/disable state belongs to MingaAgent.ProviderRegistry; this struct is the immutable contract a source contributes.

Summary

Types

Provider capability advertised to the resolver and UI.

Credential requirement id. The credential broker decides how this is satisfied.

Source that contributed this provider.

t()

Functions

Builds and validates a provider spec.

Builds a provider spec or raises on invalid input.

Types

capability()

@type capability() :: atom()

Provider capability advertised to the resolver and UI.

credential_requirement()

@type credential_requirement() :: atom()

Credential requirement id. The credential broker decides how this is satisfied.

source()

@type source() :: :config | {:bundle, atom()} | {:extension, atom()}

Source that contributed this provider.

t()

@type t() :: %MingaAgent.Provider.Spec{
  capabilities: [capability()],
  credential_requirements: [credential_requirement()],
  display_name: String.t(),
  id: String.t(),
  model_prefixes: [String.t()],
  module: module(),
  source: source()
}

Functions

new(attrs)

@spec new(keyword() | map()) :: {:ok, t()} | {:error, term()}

Builds and validates a provider spec.

new!(attrs)

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

Builds a provider spec or raises on invalid input.