-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Min tokens in token limiter #2400
Min tokens in token limiter #2400
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2400 +/- ##
==========================================
+ Coverage 33.33% 33.50% +0.17%
==========================================
Files 83 81 -2
Lines 8636 8741 +105
Branches 1835 1868 +33
==========================================
+ Hits 2879 2929 +50
- Misses 5516 5564 +48
- Partials 241 248 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@giorgossideris Thanks for the PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR is shaping up nicely
Just a reminder to update the guide and notebook |
Co-authored-by: Wael Karkoub <[email protected]>
…orgossideris/autogen into min_tokens_in_history_limiter
@WaelKarkoub I made the discussed changes, although there are two points that concern me:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the changes! A couple more looks and this is mergeable.
- Your current validator makes sense.
min_tokens <= max_tokens
- No need for a major rewrite, just a simple demonstration of how min_tokens works is enough
@WaelKarkoub I made the requested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good!
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
- | Generic High Entropy Secret | 899c472 | test/oai/test_utils.py | View secret | |
- | Generic CLI Secret | df20e0b | .github/workflows/dotnet-release.yml | View secret | |
- | Generic High Entropy Secret | 899c472 | test/oai/test_utils.py | View secret | |
- | Generic High Entropy Secret | 899c472 | test/oai/test_utils.py | View secret | |
- | Generic High Entropy Secret | 899c472 | test/oai/test_utils.py | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
Hello @ekzhu, do you want me to do anything related to the failed test? |
* Add minimum token threshold in MessageHistoryLimiter * Update transforms tests for the threshold * Move min_threshold_tokens from Message to Token Limiter * Optimize _check_tokens_threshold Co-authored-by: Wael Karkoub <[email protected]> * Apply requested changes (renaming, phrasing, validations) * Fix format * Fix _check_tokens_threshold logic * Update docs and notebook * Improve phrasing * Add min_tokens example in notebook * Add min_tokens example in website docs * Add min_tokens example in notebook * Update website docs to be in sync with get_logs change --------- Co-authored-by: Wael Karkoub <[email protected]> Co-authored-by: Chi Wang <[email protected]>
Why are these changes needed?
A
min_tokens_threshold
is added toMessageTokenLimiter
, which gives the option to cut tokens only after the specified message limit is reached.Related issue number
Closes #2306.
Checks