Skip to content

Add encode options support to token limit checks#80

Merged
niieani merged 1 commit into
mainfrom
codex/add-special-character-support-to-iswithintokenlimit
Oct 9, 2025
Merged

Add encode options support to token limit checks#80
niieani merged 1 commit into
mainfrom
codex/add-special-character-support-to-iswithintokenlimit

Conversation

@niieani
Copy link
Copy Markdown
Owner

@niieani niieani commented Oct 9, 2025

Summary

  • allow passing EncodeOptions to isWithinTokenLimit, encodeChat, and encodeChatGenerator so special tokens can be permitted during incremental counting
  • propagate encode options through countTokens chat handling and refresh the README examples and docs
  • extend unit tests to cover special token scenarios for both string and chat inputs

Testing

  • node node_modules/.bin/tsc --noEmit
  • node node_modules/.bin/eslint 'src/*.{js,jsx,ts,tsx}'
  • node .yarn/releases/yarn-4.10.3.cjs rrun vitest

fixes #74


https://chatgpt.com/codex/tasks/task_e_68e83bb683608323b2330810fbf2bca3

@niieani niieani merged commit dcc8783 into main Oct 9, 2025
5 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 9, 2025

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isWithinTokenLimit Throws Error on Special Characters

1 participant