-
Notifications
You must be signed in to change notification settings - Fork 662
[refactor][backend]-Optimizing Parameter Validation with thrift_validator #70
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
base: main
Are you sure you want to change the base?
Conversation
|
Thank you for your code! We will review and merge the code after our tests pass. |
Hello, I have already resolved the compilation failure issue. Please take another look. |
@lsy357 Could you please review this PR for any additional feedback? |
We will test the code today, and once the results are approved, we will merge it. |
3: required evaluator.EvaluatorType evaluator_type (api.body='evaluator_type', go.tag='json:"evaluator_type"') | ||
4: optional string name (api.body='name', go.tag='json:"name"') // 展示用名称 | ||
5: optional string description (api.body='description', go.tag='json:"description"') // 描述 | ||
4: optional string name (api.body='name', go.tag='json:"name"',vt.not_nil="true") // 展示用名称 |
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.
The fields "name" and "description" are allowed to be empty, so the "not_nil" constraint should be removed.
3: optional string description (vt.max_size = "2048"), | ||
4: optional eval_set.EvaluationSetSchema evaluation_set_schema, | ||
2: optional string name (vt.not_nil="true",vt.min_size = "1", vt.max_size = "255"), | ||
3: optional string description (vt.max_size = "2048",vt.not_nil="true"), |
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.
It is recommended that the "description" field does not require the "not_nil" validation.
1: required i64 workspace_id (api.body='workspace_id', api.js_conv='true', go.tag='json:"workspace_id"',vt.not_in="0") | ||
2: required i64 evaluator_id (api.path='evaluator_id', api.js_conv='true', go.tag='json:"evaluator_id"',vt.not_in="0") | ||
3: required string version (api.body='version',vt.min_size="1") | ||
4: optional string description (api.body='description',vt.not_nil="true") |
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.
It is recommended that the "description" field does not require the "not_nil" validation.
2: optional i64 workspace_id (api.js_conv = 'true', go.tag = 'json:"workspace_id"',vt.not_nil="true") | ||
3: optional EvaluatorType evaluator_type (vt.not_nil="true") | ||
4: optional string name (vt.not_nil="true") | ||
5: optional string description (vt.not_nil="true") |
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.
The same, description optional.
6: optional bool draft_submitted | ||
7: optional common.BaseInfo base_info | ||
11: optional EvaluatorVersion current_version | ||
7: optional common.BaseInfo base_info (vt.not_nil="true") |
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.
I think base_info/current_version should be remained optional.
2: optional list<runtime.Message> messages (vt.min_size="1") | ||
// 工具 | ||
3: optional list<runtime.Tool> tools | ||
3: optional list<runtime.Tool> tools (vt.min_size="1") |
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.
tools might be len 0, should be no min_size restriction.
What type of PR is this?
refactor: Optimizing Parameter Validation with thrift_validator
Check the PR title.
(Optional) Translate the PR title into Chinese.
[refactor]使用thrift_validator优化参数校验-减少硬编码
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en:
zh(optional):
主要变更evaluator和llm相关的参数校验
(Optional) Which issue(s) this PR fixes: