[Bugfix][Rust Frontend] Reject min_tokens above max_tokens (#46733)

Co-authored-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: reidliu41 <reid201711@gmail.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
This commit is contained in:
Reid
2026-06-26 03:41:33 +00:00
committed by GitHub
co-authored by Bugen Zhao
parent dbc49b6b99
commit d350fa8ddd
6 changed files with 153 additions and 28 deletions
+11
View File
@@ -74,6 +74,17 @@ pub enum Error {
pub type Result<T> = std::result::Result<T, Error>;
impl Error {
/// Whether this error represents invalid user request parameters.
pub fn is_request_validation_error(&self) -> bool {
match self {
Self::PromptTooLong { .. } => true,
Self::Text(error) => error.is_request_validation_error(),
_ => false,
}
}
}
/// Format the available-parser suffix used in user-facing error messages.
fn available_parser_hint(available_names: &[String]) -> String {
if available_names.is_empty() {