File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,15 @@ StreamOutputParser::StreamOutputParser(
2727 reasoning_parser_format_(reasoning_parser_format),
2828 force_reasoning_(force_reasoning) {
2929 sequence_parsers_.resize (1 );
30- sequence_parsers_[0 ].tool_call_parser =
31- std::make_unique<function_call::FunctionCallParser>(
32- tools_, tool_call_parser_format_);
33- sequence_parsers_[0 ].reasoning_parser_ = std::make_unique<ReasoningParser>(
34- reasoning_parser_format_, true , force_reasoning_);
30+ if (is_tool_call ()) {
31+ sequence_parsers_[0 ].tool_call_parser =
32+ std::make_unique<function_call::FunctionCallParser>(
33+ tools_, tool_call_parser_format_);
34+ }
35+ if (is_reasoning ()) {
36+ sequence_parsers_[0 ].reasoning_parser_ = std::make_unique<ReasoningParser>(
37+ reasoning_parser_format_, true , force_reasoning_);
38+ }
3539}
3640
3741bool StreamOutputParser::is_tool_call () {
You can’t perform that action at this time.
0 commit comments