diff --git a/src/common/AutoModel/modeling_nanbeige.cpp b/src/common/AutoModel/modeling_nanbeige.cpp index edfe7b64b..57c16349c 100644 --- a/src/common/AutoModel/modeling_nanbeige.cpp +++ b/src/common/AutoModel/modeling_nanbeige.cpp @@ -295,7 +295,7 @@ NonStreamResult Nanbeige::parse_nstream_content(const std::string response_text) size_t brace_end = json_str.rfind("}"); // Find the last closing brace if (brace_start != std::string::npos && brace_end != std::string::npos && brace_end > brace_start) { - arguments = json_str.substr(brace_start, brace_end - brace_start); + arguments = json_str.substr(brace_start, brace_end - brace_start + 1); } } diff --git a/src/common/AutoModel/modeling_qwen2.cpp b/src/common/AutoModel/modeling_qwen2.cpp index efc027743..50aab3553 100644 --- a/src/common/AutoModel/modeling_qwen2.cpp +++ b/src/common/AutoModel/modeling_qwen2.cpp @@ -133,7 +133,7 @@ NonStreamResult Qwen2::parse_nstream_content(const std::string response_text) { size_t brace_end = json_str.rfind("}"); // Find the last closing brace if (brace_start != std::string::npos && brace_end != std::string::npos && brace_end > brace_start) { - arguments = json_str.substr(brace_start, brace_end - brace_start); + arguments = json_str.substr(brace_start, brace_end - brace_start + 1); } } diff --git a/src/common/AutoModel/modeling_qwen3.cpp b/src/common/AutoModel/modeling_qwen3.cpp index 4881e291f..1104179c9 100644 --- a/src/common/AutoModel/modeling_qwen3.cpp +++ b/src/common/AutoModel/modeling_qwen3.cpp @@ -148,7 +148,7 @@ NonStreamResult Qwen3::parse_nstream_content(const std::string response_text) { size_t brace_end = json_str.rfind("}"); // Find the last closing brace if (brace_start != std::string::npos && brace_end != std::string::npos && brace_end > brace_start) { - arguments = json_str.substr(brace_start, brace_end - brace_start); + arguments = json_str.substr(brace_start, brace_end - brace_start + 1); } } @@ -293,7 +293,7 @@ NonStreamResult Qwen3_IT::parse_nstream_content(const std::string response_text) size_t brace_end = json_str.rfind("}"); // Find the last closing brace if (brace_start != std::string::npos && brace_end != std::string::npos && brace_end > brace_start) { - arguments = json_str.substr(brace_start, brace_end - brace_start); + arguments = json_str.substr(brace_start, brace_end - brace_start + 1); } } @@ -497,7 +497,7 @@ NonStreamResult Qwen3_TK::parse_nstream_content(const std::string response_text) size_t brace_end = json_str.rfind("}"); // Find the last closing brace if (brace_start != std::string::npos && brace_end != std::string::npos && brace_end > brace_start) { - arguments = json_str.substr(brace_start, brace_end - brace_start); + arguments = json_str.substr(brace_start, brace_end - brace_start + 1); } } diff --git a/src/common/AutoModel/modeling_qwen3_5vl.cpp b/src/common/AutoModel/modeling_qwen3_5vl.cpp index 0ce0e2a77..87e66fcac 100644 --- a/src/common/AutoModel/modeling_qwen3_5vl.cpp +++ b/src/common/AutoModel/modeling_qwen3_5vl.cpp @@ -255,7 +255,7 @@ NonStreamResult Qwen3_5VL::parse_nstream_content(const std::string response_text size_t brace_end = json_str.rfind("}"); // Find the last closing brace if (brace_start != std::string::npos && brace_end != std::string::npos && brace_end > brace_start) { - arguments = json_str.substr(brace_start, brace_end - brace_start); + arguments = json_str.substr(brace_start, brace_end - brace_start + 1); } } diff --git a/src/common/AutoModel/modeling_qwen3vl.cpp b/src/common/AutoModel/modeling_qwen3vl.cpp index 884314b74..221072159 100644 --- a/src/common/AutoModel/modeling_qwen3vl.cpp +++ b/src/common/AutoModel/modeling_qwen3vl.cpp @@ -245,7 +245,7 @@ NonStreamResult Qwen3VL::parse_nstream_content(const std::string response_text) size_t brace_end = json_str.rfind("}"); // Find the last closing brace if (brace_start != std::string::npos && brace_end != std::string::npos && brace_end > brace_start) { - arguments = json_str.substr(brace_start, brace_end - brace_start); + arguments = json_str.substr(brace_start, brace_end - brace_start + 1); } }