MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / parse_nstream_content

Method parse_nstream_content

src/common/AutoModel/modeling_lfm2.cpp:465–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

463}
464
465NonStreamResult LFM2_5_TK::parse_nstream_content(const std::string response_text) {
466 NonStreamResult result;
467
468 std::string content, reasoning_content;
469
470 std::string think_start_tag = "<think>";
471 std::string think_end_tag = "</think>";
472
473 size_t think_start_pos = response_text.find(think_start_tag);
474 size_t think_end_pos = response_text.find(think_end_tag);
475
476
477 think_start_pos += think_start_tag.length();
478 std::string reasoning_str = response_text.substr(think_start_pos, think_end_pos - think_start_pos);
479 result.reasoning_content = reasoning_str;
480
481 std::string content_str = response_text.substr(think_end_pos + think_end_tag.length());
482 result.content = content_str;
483
484 return result;
485}
486
487StreamResult LFM2_5_TK::parse_stream_content(const std::string content) {
488 const std::string TOOL_START = "<|tool_call_start|>";

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected