Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Improves Token Limiter #2350

Merged
merged 3 commits into from
Apr 11, 2024
Merged

[Fix] Improves Token Limiter #2350

merged 3 commits into from
Apr 11, 2024

Conversation

WaelKarkoub
Copy link
Collaborator

@WaelKarkoub WaelKarkoub commented Apr 10, 2024

Why are these changes needed?

The current implementation of the token limiter, specifically the total token limiter (max_tokens arg), drops the entire message if it exceeds the total token count after truncating the content. This seems to be an undesired behavior by users as it is unintuitive. With this approach, the last message gets truncated to meet the total token count.

Related issue number

Closes #2341

Checks

@qingyun-wu qingyun-wu added this pull request to the merge queue Apr 11, 2024
Merged via the queue into main with commit 97b5433 Apr 11, 2024
73 of 77 checks passed
@qingyun-wu qingyun-wu deleted the improve-token-limiter branch April 11, 2024 13:53
whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
* improves token limiter

* improve docstr

* rename arg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working long context handling Compression to handle long context
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]:
3 participants