OpenAICompatibleWebClient

OpenAICompatibleWebClient(string, string, string)

Creates an instance of the OpenAI-compatible web client.

public OpenAICompatibleWebClient(string model, string apiKey, string baseUrl)
ParameterTypeDescription
modelStringModel name supported by the LLM provider.
apiKeyStringAPI key (token).
baseUrlStringBase URL of the OpenAI-compatible LLM.

Exceptions

exceptioncondition
ArgumentExceptionAPI key value can’t be null or empty.
ArgumentExceptionText model value can’t be null or empty.
ArgumentExceptionBase URL value can’t be null or empty.

See Also


OpenAICompatibleWebClient(string, string, string, HttpClient)

Creates an instance of the OpenAI-compatible web client that uses an externally managed HttpClient. The provided HttpClient is not disposed by this instance and remains owned by the caller.

public OpenAICompatibleWebClient(string model, string apiKey, string baseUrl, HttpClient httpClient)
ParameterTypeDescription
modelStringModel name supported by the LLM provider.
apiKeyStringAPI key (token).
baseUrlStringBase URL of the OpenAI-compatible LLM.
httpClientHttpClientAn externally managed HttpClient instance.

Exceptions

exceptioncondition
ArgumentExceptionAPI key value can’t be null or empty.
ArgumentExceptionText model value can’t be null or empty.
ArgumentExceptionBase URL value can’t be null or empty.
ArgumentNullExceptionHttpClient can’t be null.

See Also