MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / wrap_code_as_arguments

Function wrap_code_as_arguments

smallthinker/common/chat.cpp:607–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605}
606
607static 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.

Calls 3

dumpMethod · 0.80
findMethod · 0.80
resizeMethod · 0.45

Tested by

no test coverage detected