|
NeuralPlus 0.2.0
A small C++17 SDK for AI clients, sessions, tools, and tracing
|
#include <session.hpp>
Public Types | |
| using | Messages = std::vector< Message > |
| Ordered collection used for conversation snapshots. | |
Public Member Functions | |
| Session (SessionOptions options={}) | |
Creates or restores a session from options. | |
| const std::string & | id () const noexcept |
| Returns the stable session identifier. | |
| void | set_system (std::string message) |
| std::optional< std::string > | system () const |
| Returns a thread-safe copy of the system instruction. | |
| void | append (Message message) |
| Appends restored or application-managed history outside a generation. | |
| Messages | messages () const |
| Returns a thread-safe snapshot of conversation messages. | |
| void | clear_messages () |
| Clears conversation messages while retaining the system instruction and cache. | |
| SessionState & | state () noexcept |
| Returns the session-scoped generic cache. | |
| const SessionState & | state () const noexcept |
| Returns the read-only session-scoped generic cache. | |
Friends | |
| class | AIClient |
Thread-safe conversation history and tool cache.
Exactly one AIClient generation may own a Session at a time. Concurrent attempts fail immediately with SessionInUseError.
| void neuralplus::Session::set_system | ( | std::string | message | ) |
Sets the provider-independent system instruction.
It may be changed while the current conversation history is empty.