Skip to content

Commit 18e1ff0

Browse files
chat-parser: address review feedback from ngxson
Co-authored-by: Xuan Son Nguyen <[email protected]>
1 parent 37e6650 commit 18e1ff0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

common/chat-parser.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ void common_chat_msg_parser::consume_literal(const std::string & literal) {
171171
bool common_chat_msg_parser::try_parse_reasoning(const std::string & start_think, const std::string & end_think) {
172172
std::string pending_reasoning_prefix;
173173

174+
if (syntax_.reasoning_format == COMMON_REASONING_FORMAT_NONE) {
175+
return false;
176+
}
177+
174178
auto set_reasoning_prefix = [&](size_t prefix_pos) {
175179
if (!syntax_.thinking_forced_open || syntax_.reasoning_in_content) {
176180
return;
@@ -206,10 +210,6 @@ bool common_chat_msg_parser::try_parse_reasoning(const std::string & start_think
206210
}
207211
};
208212

209-
if (syntax_.reasoning_format == COMMON_REASONING_FORMAT_NONE) {
210-
return false;
211-
}
212-
213213
const size_t saved_pos = pos_;
214214
const size_t saved_content_size = result_.content.size();
215215
const size_t saved_reasoning_size = result_.reasoning_content.size();

0 commit comments

Comments
 (0)