IModelProviderRegistry
AgentPrism.Abstractions.dllThe registry that keeps registered model providers by name.
public interface IModelProviderRegistryMethods
Section titled “Methods”CreateChatClient(ModelBinding)
Section titled “ CreateChatClient(ModelBinding)”Produces a chat client for the given binding, using the provider’s setup-time credential.
IChatClient CreateChatClient(ModelBinding binding)Parameters
Section titled “Parameters”binding ModelBinding
The model binding.
Returns
Section titled “Returns”IChatClient
The chat client.
Remarks
Section titled “Remarks”This overload does not resolve a tenant provider binding (BYOK) or check an egress policy: both need an async store lookup, which this synchronous method cannot perform. Callers that must honor a tenant’s own credential and egress policy — this includes the real agent-run compile path — use IModelProviderRegistry.CreateChatClientAsync instead.
Exceptions
Section titled “Exceptions”No provider is registered with the name in ModelBinding.Provider.
CreateChatClientAsync(ModelBinding, CancellationToken)
Section titled “ CreateChatClientAsync(ModelBinding, CancellationToken)”Produces a chat client for the given binding, first resolving the current tenant’s own provider credential and egress policy.
ValueTask<IChatClient> CreateChatClientAsync(ModelBinding binding, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”binding ModelBinding
The model binding.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<IChatClient>
The chat client.
Remarks
Section titled “Remarks”When no tenant context is registered, or the tenant has no binding for the provider, behavior is identical to IModelProviderRegistry.CreateChatClient (the no-surprises rule: zero surprise when BYOK is not configured).
Exceptions
Section titled “Exceptions”No provider is registered with the name in ModelBinding.Provider, the tenant’s egress policy does not allow the provider, or the tenant’s provider binding cannot be resolved to a credential value.
HasTenantProviderOverrideAsync(ModelBinding, CancellationToken)
Section titled “ HasTenantProviderOverrideAsync(ModelBinding, CancellationToken)”Reports whether the current tenant has its own provider binding for
binding’s primary provider or any of its
ModelBinding.Fallbacks (BYOK).
ValueTask<bool> HasTenantProviderOverrideAsync(ModelBinding binding, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”binding ModelBinding
The model binding to check.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”true if a tenant-specific credential would be baked into the chat client IModelProviderRegistry.CreateChatClientAsync produces for this binding.
Remarks
Section titled “Remarks”A compiled agent’s chat client is a fixed pipeline object — once a
tenant’s credential is resolved into it, changing or deleting the
underlying binding has no further effect on that object. A cache
keyed only by definition identity (CompiledAgentCache) must
therefore never hold an agent built with a tenant-specific credential;
callers use this method to decide whether to bypass that cache.
List()
Section titled “ List()”Returns the definitions of the registered providers.
IReadOnlyList<ModelProviderDescriptor> List()Returns
Section titled “Returns”IReadOnlyList<ModelProviderDescriptor>
The provider definitions.