@brief Try to parse a JSON value from a string, returning the original string on failure.
| 196 | |
| 197 | ///@brief Try to parse a JSON value from a string, returning the original string on failure. |
| 198 | static json try_parse_json_value(const std::string& s) { |
| 199 | try { |
| 200 | return json::parse(s); |
| 201 | } |
| 202 | catch (...) { |
| 203 | return json(s); |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | ///@brief Convert OpenAI-style assistant tool_calls + following tool messages into the |
| 208 | /// Gemma4 chat-template format, which expects a single assistant message containing |
no test coverage detected