OpenAIChatClient
An LLM client for the OpenAI Chat Completions form (llm-openai-compatible §OCP-W).
| Inherits | LLMClient |
Declared in src/libs/libllm/llm/clients/OpenAIChatClient.hpp.
Detailed description
OpenAI, Google's OpenAI compatibility, OpenRouter, Groq and every self-hosted server of §OCP-R5 speak this form. The client posts to `{baseUrl}/chat/completions` with `Authorization: Bearer` when the provider has a key. The form itself is in octomy::llm::wire::openai, so this class only sends, receives and emits.
Each terminal signal comes after the call that started the request returned: LLMRequestRouter connects only then. A request to a self-hosted server waits in its provider's RequestGate for a slot, and says so with chatActivity().
See also OpenAIChatSessionFacet, OnlineAPIClient, OnlineTransport.
Member function documentation
cancelRequest
[override virtual] void OpenAIChatClient::cancelRequest(const QString &requestId)
Cancel the request requestId. It ends with no terminal signal, as the Anthropic client's does.
capabilities
[override virtual] octomy::llm::driver::Capabilities OpenAIChatClient::capabilities() const
The capabilities of the Anthropic client: the online driver factory advertises one set for every online provider (§OCP-W8).
createSession
[override virtual] octomy::llm::driver::ISession *OpenAIChatClient::createSession()
A new session facet for one conversation: a client is shared between conversations (trove-parts §TPN-9b).
gate
QSharedPointer<RequestGate> OpenAIChatClient::gate() const
The gate of the provider. Only a self-hosted provider waits in it, but every provider keeps whether it refused `stream_options` there.
isAvailable
[override virtual] bool OpenAIChatClient::isAvailable() const
Returns whether the client can send: a key, or a self-hosted server, which can need none (§OCP-D4).