| 463 | } |
| 464 | |
| 465 | NonStreamResult 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 | |
| 487 | StreamResult LFM2_5_TK::parse_stream_content(const std::string content) { |
| 488 | const std::string TOOL_START = "<|tool_call_start|>"; |
no outgoing calls
no test coverage detected