1.16.0 - New Chat History implementation
Added
TokenCounter Class
- Introduced TokenCounter for approximate token counting of chat messages
- Support for all message types including tool calls and structured content
- Implemented intelligent message history trimming to fit within token limits
- Binary search algorithm (O(log n)) for efficient message selection
- Preserves most recent messages by trimming from the beginning of history
- Ensures valid message sequence