The LlmDisconnect function closes the active connection and
releases all memory and resources associated with the specified client
session. After this function returns successfully, the client handle is
no longer valid and must not be used with any other function.
This function also releases the conversation history, cached message
and response data, provider information and any other state maintained
for the client session. To preserve information from the session,
retrieve it before calling this function.
Applications should call LlmDisconnect for every successful call
to LlmConnect or LlmConnectEx. This function should be
called before LlmUninitialize.
Avoid calling this function while another thread is using the client
handle or while a blocking request is in progress. If a request must be
canceled, call LlmCancelRequest first and wait for the blocking
function to return before disconnecting the client session. The
LlmIsBlocking function can tell you if the
library is in the middle of processing a blocking operation, such as
retrieving the response to a message prompt.