Documentation
Table of Contents

Method AddProvider

Namespace
IntentSharp
Assembly
IntentSharp.dll

AddProvider(IAIProvider)

Adds a provider that is reachable only by its name: Provider, an intent's provider, or a role of the provider options that names it. It is never part of a chain the client makes up itself: a call that names neither it nor a role that names it never reaches it, and it never becomes the primary or the fallback, so the providers of UseProvider(IAIProvider) and UseFallbackProvider(IAIProvider) still form the answer role when the provider options define none. Call it once for each provider; any number may be added. The client disposes each one like the primary and the fallback, so do not share one instance between clients.

public IntentClientBuilder AddProvider(IAIProvider provider)

Parameters

provider IAIProvider

The provider, named by its Name.

Returns

IntentClientBuilder

Exceptions

ArgumentNullException

provider is null.

ArgumentException

The primary, the fallback or another provider added here already has this provider's name (compared case-insensitively). An entry of the provider options with the same name is refused as for any provider added in code: a provider file that has one does not load, and a source of your own that returns one makes Build() throw ProviderConfigurationException.