MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / try_parse_json_value

Function try_parse_json_value

src/server/rest_handler.cpp:198–205  ·  view source on GitHub ↗

@brief Try to parse a JSON value from a string, returning the original string on failure.

Source from the content-addressed store, hash-verified

196
197///@brief Try to parse a JSON value from a string, returning the original string on failure.
198static 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

Callers 1

Calls 1

parseFunction · 0.85

Tested by

no test coverage detected