OpenAICompatibleWebClient

OpenAICompatibleWebClient class

A built-in IAIWebClient implementation that connects to an OpenAI-compatible LLM provider at a specified base URL.

public sealed class OpenAICompatibleWebClient : IAIWebClient, IDisposable

Constructors

NameDescription
OpenAICompatibleWebClient(string, string, string)Creates an instance of the OpenAI-compatible web client.
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.

Methods

NameDescription
CallChatAsync(string)Sends a chat instruction to the AI model using an externally managed HttpClient instance and returns response message to the given instruction.
CreateConversation()Creates a conversation instance. Unlike regular AI calls, conversations retain the entire context.
Dispose()Releases resources used by this instance.

See Also