Skip to content

1.16.0 - New Chat History implementation

Compare
Choose a tag to compare
@ilvalerione ilvalerione released this 25 Jul 11:41
· 484 commits to main since this release

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