| 62 | } |
| 63 | |
| 64 | static 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 | } |
| 75 | template <> |
| 76 | bool equals(const common_chat_msg & expected, const common_chat_msg & actual) { |
| 77 | return normalize(expected) == normalize(actual); |
no test coverage detected