adk_provider_registry (erlang_adk v0.8.0)

View Source

Read-only resolver for operator-configured model provider profiles.

Profiles are loaded from the erlang_adk application environment under provider_profiles. Only bounded binary IDs are accepted. In particular, this module never converts user-provided binaries to module atoms.

Summary

Functions

Resolve a new binary profile configuration, or explicitly identify an existing atom-module configuration as legacy. Caller-supplied authority fields are rejected for profile configurations rather than merged over the operator-owned profile.

Resolve an operator-owned Live adapter, endpoint, concrete model and transport. The public profile identifier and model alias remain binaries; only modules which were already present in the trusted profile are called. Fixed transports must agree with the profile endpoint and be selected by the adapter itself through transport/0.

Resolve the profile portion of a public Live session configuration. model is an operator-defined alias. All other entries are provider options; authority-bearing values are rejected before they can be merged with the concrete model identifier from the profile.

Functions

lookup(ProfileId)

-spec lookup(term()) -> {ok, map()} | {error, term()}.

profiles()

-spec profiles() -> {ok, map()} | {error, term()}.

resolve(ProfileId)

-spec resolve(term()) -> {ok, map()} | {error, term()}.

resolve(ProfileId, ModelAlias)

-spec resolve(term(), term()) -> {ok, map()} | {error, term()}.

resolve_config(Config)

-spec resolve_config(term()) -> {ok, map()} | {error, term()}.

Resolve a new binary profile configuration, or explicitly identify an existing atom-module configuration as legacy. Caller-supplied authority fields are rejected for profile configurations rather than merged over the operator-owned profile.

resolve_live(ProfileId, ModelAlias)

-spec resolve_live(term(), term()) -> {ok, map()} | {error, term()}.

Resolve an operator-owned Live adapter, endpoint, concrete model and transport. The public profile identifier and model alias remain binaries; only modules which were already present in the trusted profile are called. Fixed transports must agree with the profile endpoint and be selected by the adapter itself through transport/0.

resolve_live_config(ProfileId, ProviderConfig)

-spec resolve_live_config(term(), term()) -> {ok, map()} | {error, term()}.

Resolve the profile portion of a public Live session configuration. model is an operator-defined alias. All other entries are provider options; authority-bearing values are rejected before they can be merged with the concrete model identifier from the profile.