Constructor HttpProviderBase
- Namespace
- IntentSharp.Providers
- Assembly
- IntentSharp.dll
HttpProviderBase(HttpProviderSettings, HttpClient?, Uri, ILogger?)
Validates the settings and prepares the HTTP client.
protected HttpProviderBase(HttpProviderSettings settings, HttpClient? httpClient, Uri defaultBaseAddress, ILogger? logger)
Parameters
settingsHttpProviderSettingsThe API key, model, address, timeout and retry settings.
httpClientHttpClientThe 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).
defaultBaseAddressUriThe service address used when neither the settings nor the client has one.
loggerILoggerReceives a
Warningfor every retry. Null discards them.
Exceptions
- ArgumentNullException
settingsis null.- ArgumentException
The settings have no API key or no model.