-
Notifications
You must be signed in to change notification settings - Fork 563
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
Update token_handler.py #774
Conversation
PR Description updated to latest commit (a461c2a)
|
PR Review
✨ Review tool usage guide:Overview:
With a configuration file, use the following template:
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
With a configuration file, use the following template:
See the improve usage page for a more comprehensive guide on using this tool. |
/help |
PR Agent Walkthrough🤖 Welcome to the PR Agent, an AI-powered tool for automated pull request analysis, feedback, suggestions and more. Here is a list of tools you can use to interact with the PR Agent:
(1) Note that each tool be triggered automatically when a new PR is opened, or called manually by commenting on a PR. (2) Tools marked with [*] require additional parameters to be passed. For example, to invoke the |
PR DocumentationHere is a list of the files that were modified in the PR, with docstring for each altered code component:
|
PR Analysis
✨ Usage guide:Using static code analysis capabilities, the
Language that are currently supported: Python, Java, C++, JavaScript, TypeScript. |
Changelog updates: markdown 2024-03-11Enhanced
|
Generated tests for '_get_system_user_tokens'
Component signature: def _get_system_user_tokens(self, pr, encoder, vars: dict, system, user):
✨ Test tool usage guide:The
where 'component_name' is the name of a specific component in the PR. To get a list of the components that changed in the PR, use the Configuration options: See more information about the test tool in the docs. |
Type
bug_fix, enhancement
Description
_get_system_user_tokens
to return-1
when an exception occurs, enhancing the robustness of token calculations.count_tokens
method without altering its functionality.Changes walkthrough
token_handler.py
Enhance Token Calculation Robustness and Error Handling
pr_agent/algo/token_handler.py
_get_system_user_tokens
with a try-exceptblock.
-1
if an exception occurs during token calculation.count_tokens
method functionality, just formattingadjustment.