Skip to content
Tracon

ITenantCredentialModelProvider

Namespace Tracon · Assembly Tracon.Abstractions.dll

A model provider that can build clients from resolved per-tenant credentials.

public interface ITenantCredentialModelProvider : IModelProvider

IModelProvider

Implement this interface only when the provider supports tenant-provided credentials. A provider that implements only IModelProvider continues to use its setup-time credential. If a tenant binding exists for such a provider, Tracon fails before invoking the provider and never falls back to the setup-time credential.

A compiled agent’s chat client is a fixed pipeline object. A client built with a tenant credential is therefore never stored in the shared compile cache. The registry enforces this through IModelProviderRegistry.HasTenantProviderOverrideAsync.

CreateChatClient(ModelBinding, ModelProviderCredential)

Section titled “ CreateChatClient(ModelBinding, ModelProviderCredential)”

Produces a raw chat client using a resolved tenant credential.

IChatClient CreateChatClient(ModelBinding binding, ModelProviderCredential credential)

binding ModelBinding

The model binding.

credential ModelProviderCredential

The non-null tenant credential.

IChatClient

The provider-specific raw chat client.

The implementation uses ModelProviderCredential.ApiKey and, when present, ModelProviderCredential.Endpoint. The API key must never fall back to the setup-time key. An endpoint may fall back to a setup-time endpoint when only the key is overridden.