Skip to content

docs(custom-drivers): document countTokens() on custom text handlers - #61

Merged
timothymarois merged 1 commit into
3.xfrom
docs/custom-driver-count-tokens
Jul 20, 2026
Merged

docs(custom-drivers): document countTokens() on custom text handlers#61
timothymarois merged 1 commit into
3.xfrom
docs/custom-driver-count-tokens

Conversation

@timothymarois

Copy link
Copy Markdown
Member

TextHandler requires countTokens() (added in v3.6.0), but the custom-drivers guide's example and interface table omitted it — a handler built from the docs failed to load. Documents countTokens() with a drop-in implementation via the CountsTokens trait (heuristic estimate when a provider has no native count endpoint), adds it to the interface table, and updates the sandbox custom-driver example to match.

The feature itself is correct (all first-party handlers implement it; live token-counting verified 22/22) — docs gap only.

TextHandler requires countTokens() (added in v3.6.0), but the
custom-drivers guide's example and interface table omitted it, so a
handler built from the docs failed to load. Document countTokens() with
a drop-in implementation via the CountsTokens trait (heuristic estimate
when a provider has no native count endpoint), and add it to the
interface table. Update the sandbox custom-driver example to match.

The feature itself is correct (all first-party handlers implement it;
live token-counting verified 22/22) — this is a docs gap only.
@timothymarois
timothymarois merged commit 6eb7ebe into 3.x Jul 20, 2026
4 checks passed
@timothymarois
timothymarois deleted the docs/custom-driver-count-tokens branch July 20, 2026 23:48
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant