Merged
Conversation
Contributor
审阅者指南(在小型 PR 上折叠显示)审阅者指南停止将自定义工具参数强制转换为带类型的值,而是按原样转发到查询字符串和请求体中,从而简化自定义工具基类的行为。 更新后的自定义工具基类参数处理类图classDiagram
class CustomToolBase_before {
_build_request_url(operation: Dict~str, Any~, params: Dict~str, Any~) Dict~str, Any~
_build_request_headers(operation: Dict~str, Any~) Dict~str, str~
_coerce_param(value: Any, schema_type: str) Any
_build_request_data(operation: Dict~str, Any~, params: Dict~str, Any~) Optional~Dict~str, Any~~
_send_http_request(operation: Dict~str, Any~, params: Dict~str, Any~) Any
}
class CustomToolBase_after {
_build_request_url(operation: Dict~str, Any~, params: Dict~str, Any~) Dict~str, Any~
_build_request_headers(operation: Dict~str, Any~) Dict~str, str~
_build_request_data(operation: Dict~str, Any~, params: Dict~str, Any~) Optional~Dict~str, Any~~
_send_http_request(operation: Dict~str, Any~, params: Dict~str, Any~) Any
}
CustomToolBase_before <|-- CustomToolBase_after
note for CustomToolBase_before "Parameters for query and body are coerced using _coerce_param before being sent"
note for CustomToolBase_after "Parameter coercion removed; values are forwarded as-is into query strings and request bodies"
文件级变更
提示与命令与 Sourcery 交互
自定义你的使用体验访问你的 dashboard 以:
获取帮助Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuideStops coercing custom-tool parameters into typed values and instead forwards them as-is into query strings and request bodies, simplifying the custom tool base class behavior. Class diagram for updated custom tool base parameter handlingclassDiagram
class CustomToolBase_before {
_build_request_url(operation: Dict~str, Any~, params: Dict~str, Any~) Dict~str, Any~
_build_request_headers(operation: Dict~str, Any~) Dict~str, str~
_coerce_param(value: Any, schema_type: str) Any
_build_request_data(operation: Dict~str, Any~, params: Dict~str, Any~) Optional~Dict~str, Any~~
_send_http_request(operation: Dict~str, Any~, params: Dict~str, Any~) Any
}
class CustomToolBase_after {
_build_request_url(operation: Dict~str, Any~, params: Dict~str, Any~) Dict~str, Any~
_build_request_headers(operation: Dict~str, Any~) Dict~str, str~
_build_request_data(operation: Dict~str, Any~, params: Dict~str, Any~) Optional~Dict~str, Any~~
_send_http_request(operation: Dict~str, Any~, params: Dict~str, Any~) Any
}
CustomToolBase_before <|-- CustomToolBase_after
note for CustomToolBase_before "Parameters for query and body are coerced using _coerce_param before being sent"
note for CustomToolBase_after "Parameter coercion removed; values are forwarded as-is into query strings and request bodies"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - 我在这里给出了一些高层次的反馈:
_build_request_data方法仍然定义为类方法(缩进在类内部),但现在既没有接收self,也没有加上@staticmethod,这会导致像self._build_request_data(...)这样的现有调用位置出错;要么重新引入self,要么明确将其设为静态方法并相应更新所有调用位置。- 由于
_coerce_param已被移除,请仔细检查在该类或代码库的其他地方是否还存在对它的引用,以避免运行时属性错误。
给 AI 代理的提示
Please address the comments from this code review:
## Overall Comments
- `_build_request_data` 方法仍然定义为类方法(缩进在类内部),但现在既没有接收 `self`,也没有加上 `@staticmethod`,这会导致像 `self._build_request_data(...)` 这样的现有调用位置出错;要么重新引入 `self`,要么明确将其设为静态方法并相应更新所有调用位置。
- 由于 `_coerce_param` 已被移除,请仔细检查在该类或代码库的其他地方是否还存在对它的引用,以避免运行时属性错误。帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续的审查。
Original comment in English
Hey - I've left some high level feedback:
- The
_build_request_datamethod is still defined as a class method (indented inside the class) but no longer takesselfor has@staticmethod, which will break existing call sites likeself._build_request_data(...); either reintroduceselfor make it explicitly static and update call sites accordingly. - Since
_coerce_paramwas removed, double-check there are no remaining references to it elsewhere in the class or codebase to avoid runtime attribute errors.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `_build_request_data` method is still defined as a class method (indented inside the class) but no longer takes `self` or has `@staticmethod`, which will break existing call sites like `self._build_request_data(...)`; either reintroduce `self` or make it explicitly static and update call sites accordingly.
- Since `_coerce_param` was removed, double-check there are no remaining references to it elsewhere in the class or codebase to avoid runtime attribute errors.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
remove parameter coercion in custom tool base class
Summary by Sourcery
错误修复:
Original summary in English
Summary by Sourcery
Bug Fixes: