MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / func_args_not_string

Function func_args_not_string

common/chat.cpp:2013–2031  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2011}
2012
2013static void func_args_not_string(json & messages) {
2014 GGML_ASSERT(messages.is_array());
2015 for (auto & message : messages) {
2016 if (message.contains("tool_calls")) {
2017 for (auto & tool_call : message["tool_calls"]) {
2018 if (tool_call.contains("function") && tool_call["function"].contains("arguments")) {
2019 auto & args = tool_call["function"]["arguments"];
2020 if (args.is_string()) {
2021 try {
2022 args = json::parse(args.get<std::string>());
2023 } catch (const std::exception & e) {
2024 throw std::runtime_error("Failed to parse tool call arguments as JSON: " + std::string(e.what()));
2025 }
2026 }
2027 }
2028 }
2029 }
2030 }
2031}
2032
2033}
2034

Callers 1

Calls 3

stringClass · 0.85
containsMethod · 0.80
whatMethod · 0.45

Tested by

no test coverage detected