| 605 | } |
| 606 | |
| 607 | static std::string wrap_code_as_arguments(common_chat_msg_parser & builder, const std::string & code) { |
| 608 | std::string arguments; |
| 609 | if (builder.is_partial()) { |
| 610 | arguments = (json {{"code", code + builder.healing_marker()}}).dump(); |
| 611 | auto idx = arguments.find(builder.healing_marker()); |
| 612 | if (idx != std::string::npos) { |
| 613 | arguments.resize(idx); |
| 614 | } |
| 615 | } else { |
| 616 | arguments = (json {{"code", code}}).dump(); |
| 617 | } |
| 618 | return arguments; |
| 619 | } |
| 620 | |
| 621 | /** |
| 622 | * Takes a prefix regex that must have 1 group to capture the function name, a closing suffix, and expects json parameters in between. |
no test coverage detected