leaveLastNMessages

Keeps only the last N messages in the session's prompt by removing all earlier messages.

Parameters

n

The number of most recent messages to retain in the session's prompt.