The ResetSession method resets the client session to its
initial state. Any active connection to the service provider is closed,
the conversation history is cleared, and token usage statistics for the
session are reset.
This method can be used to discard the current conversation context
and start a new session using the existing client handle. Configuration
settings such as the selected provider, model name, system prompt, and
client options are preserved.
If a blocking operation is currently in progress, this method will
fail. Applications should call IsBlocking to determine if the
client is busy before attempting to reset the session.
Because this method clears the conversation history, it also
invalidates any string pointers previously returned in LLM_RESPONSE
structures or by message history methods. Applications must not use
those pointers after this method returns. If the application needs to
keep any message or response text, it should make its own copy before
resetting the session.