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

Function normalize

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

Source from the content-addressed store, hash-verified

62}
63
64static common_chat_msg normalize(const common_chat_msg & msg) {
65 common_chat_msg normalized = msg;
66 for (auto & tool_call : normalized.tool_calls) {
67 try {
68 tool_call.arguments = json::parse(tool_call.arguments).dump();
69 } catch (const std::exception &) {
70 // Do nothing
71 }
72 }
73 return normalized;
74}
75template <>
76bool equals(const common_chat_msg & expected, const common_chat_msg & actual) {
77 return normalize(expected) == normalize(actual);

Callers 3

equalsFunction · 0.70
tokenizeMethod · 0.50
compute_boundariesFunction · 0.50

Calls 2

dumpMethod · 0.80
parseFunction · 0.50

Tested by

no test coverage detected