OpenAIChatSessionFacet
The ISession facet of OpenAIChatClient: a conversation in the OpenAI Chat form (llm-openai-compatible §OCP-W1).
| Inherits | octomy::llm::driver::ISession |
Declared in src/libs/libllm/llm/clients/OpenAIChatSessionFacet.hpp.
Detailed description
It keeps its history and its system prompt, and each turn sends the whole conversation, as the OpenAI form keeps no conversation on the server. It emits the signals in the order of OnlineSessionFacet: sessionStateChanged(Working), then activityObserved() and transcriptDelta(), then tokensUpdated(), promptCompleted() and sessionStateChanged(Idle) on success, or promptCompleted() and Idle on failure. A failed or interrupted turn leaves no trace in the history.
Reasoning, which llama.cpp sends as `reasoning_content` and Ollama and vLLM as `reasoning`, shows as the activity "Thinking". It never goes into the transcript (§OCP-W4). A turn to a self-hosted server waits in the provider's RequestGate, and its activity says how many turns are ahead.
See also OpenAIChatClient.
Member function documentation
adoptSession
[override virtual] void OpenAIChatSessionFacet::adoptSession(const QString &providerSession, const octomy::llm::driver::History &history)
Take history as the history that the next turn sends. providerSession is ignored.
interrupt
[override virtual] void OpenAIChatSessionFacet::interrupt()
Stop the running turn. An interrupted turn is not a failed one: it has no promptCompleted(), and it leaves no trace in the history.
providerSession
[override virtual] QString OpenAIChatSessionFacet::providerSession() const
Always empty: the OpenAI form keeps no conversation. The history is the state.
sendFiles
[override virtual] void OpenAIChatSessionFacet::sendFiles(const QStringList &paths)
Queue paths for the next turn: text files as text with their names, images as images, and a PDF refused with its reason (§OCP-W3).