Creates a basic conversation Session. Allocates a new KV Cache slot and context manager within the engine.
Each Conversation handle holds an independent context state machine. It is responsible for recording dialogue history and occupies VRAM space defined by max_num_tokens.
void* LiteRtLm_CreateConversation(void* engine_ptr);
| Parameter / Return Value | Detailed Description |
|---|---|
engine_ptr |
Valid engine pointer returned by CreateEngine. |
Return Value (void*) |
Session handle. Used for subsequent message appending and triggering Inference. Returns NULL if creation fails (e.g., insufficient VRAM to allocate a new slot). |
// Create a new Session without any history
void* MyConversation = LiteRtLm_CreateConversation(EngineHandle);
if (MyConversation) {
// Ready to start conversation...
}