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

Function renormalize_json

smallthinker/tests/test-chat.cpp:139–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139static std::string renormalize_json(const std::string & json_str) {
140 try {
141 auto json_obj = json::parse(json_str);
142 return json_obj.dump();
143 } catch (const std::exception & e) {
144 std::cerr << "Failed to parse JSON: " << e.what() << '\n';
145 return json_str;
146 }
147}
148static void assert_msg_equals(const common_chat_msg & expected, const common_chat_msg & actual) {
149 assert_equals(expected.role, actual.role);
150 assert_equals(expected.content, actual.content);

Callers 1

assert_msg_equalsFunction · 0.85

Calls 3

dumpMethod · 0.80
parseFunction · 0.50
whatMethod · 0.45

Tested by

no test coverage detected