Documentation
Table of Contents

Constructor AnthropicProvider

Namespace
IntentSharp.Providers
Assembly
IntentSharp.dll

AnthropicProvider(string, string?, HttpClient?, ILogger?)

Creates the provider with an API key and the default settings.

public AnthropicProvider(string apiKey, string? model = null, HttpClient? httpClient = null, ILogger? logger = null)

Parameters

apiKey string

The Anthropic API key.

model string

The model used when a request names none. Null uses DefaultModelId.

httpClient HttpClient

The client to send requests with. Null creates one that the provider owns and disposes; a supplied client is never disposed by the provider and keeps its own timeout (see Timeout).

logger ILogger

Receives a Warning for every retry. Null discards them.

Exceptions

ArgumentException

apiKey is null, empty or white space.

AnthropicProvider(HttpProviderSettings, HttpClient?, ILogger?)

Creates the provider from full settings.

public AnthropicProvider(HttpProviderSettings settings, HttpClient? httpClient = null, ILogger? logger = null)

Parameters

settings HttpProviderSettings

The API key, model, address, timeout and retry settings.

httpClient HttpClient

The client to send requests with. Null creates one that the provider owns and disposes; a supplied client is never disposed by the provider and keeps its own timeout (see Timeout).

logger ILogger

Receives a Warning for every retry. Null discards them.

Exceptions

ArgumentNullException

settings is null.

ArgumentException

The settings have no API key or no model.