MCPcopy Create free account
hub / github.com/AGenUI/AGenUI / fromJson

Method fromJson

core/src/function_call/agenui_functioncall_config.cpp:11–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9}
10
11FunctionCallConfig FunctionCallConfig::fromJson(const nlohmann::json& json) {
12 FunctionCallConfig config;
13
14 if (json.contains("namespace") && json["namespace"].is_string()) {
15 config._namespace = json["namespace"].get<std::string>();
16 }
17
18 if (json.contains("name") && json["name"].is_string()) {
19 config._name = json["name"].get<std::string>();
20 }
21
22 if (json.contains("description") && json["description"].is_string()) {
23 config._description = json["description"].get<std::string>();
24 }
25
26 if (json.contains("returnType") && json["returnType"].is_string()) {
27 config._returnType = json["returnType"].get<std::string>();
28 }
29
30 return config;
31}
32
33nlohmann::json FunctionCallConfig::toJson() const {
34 nlohmann::json json;

Callers 1

parseComponentDataMethod · 0.80

Calls 1

containsMethod · 0.80

Tested by

no test coverage detected