Destroys a conversation session. Releases the KV Cache slot occupied by this session in the GPU and cleans up all historical message memory.
Calling this function is critical to maintaining long-term operational stability. For conversations that are no longer active (e.g., closed UI windows or destroyed NPC Actors), it must be explicitly called to prevent VRAM fragmentation or exhaustion.
void LiteRtLm_DestroyConversation(void* conv_ptr);
| Parameter | Description |
|---|---|
conv_ptr |
The session handle to destroy. After invocation, this pointer and the associated KV Cache will be immediately invalidated. |
// End conversation and recover VRAM
if (ActiveConversation) {
LiteRtLm_DestroyConversation(ActiveConversation);
ActiveConversation = nullptr;
}