MCPcopy Create free account
hub / github.com/antirez/ds4 / parse_tool_calls_value

Function parse_tool_calls_value

ds4_server.c:1118–1176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1116 if (!strcmp(key, "effort")) {
1117 if (!parse_reasoning_effort_value(p, effort)) {
1118 free(key);
1119 return false;
1120 }
1121 } else if (!json_skip_value(p)) {
1122 free(key);
1123 return false;
1124 }
1125 free(key);
1126 json_ws(p);
1127 if (**p == ',') (*p)++;
1128 json_ws(p);
1129 }
1130 if (**p != '}') return false;
1131 (*p)++;
1132 return true;
1133}
1134
1135static bool model_alias_disables_thinking(const char *model) {
1136 return model &&
1137 (!strcmp(model, "deepseek-chat") ||
1138 !strcmp(model, "glm-5.2-chat") ||
1139 !strcmp(model, "glm-5.2-no-think") ||
1140 !strcmp(model, "glm-5.2-nothink") ||
1141 !strcmp(model, "zai/glm-5.2-chat") ||
1142 !strcmp(model, "glm-5.3-flash-chat") ||
1143 !strcmp(model, "glm-5.3-flash-no-think") ||
1144 !strcmp(model, "glm-5.3-flash-nothink") ||
1145 !strcmp(model, "zai/glm-5.3-flash-chat"));
1146}
1147
1148static bool model_alias_enables_thinking(const char *model) {
1149 return model &&
1150 (!strcmp(model, "deepseek-reasoner") ||
1151 !strcmp(model, "glm-5.2-reasoner") ||
1152 !strcmp(model, "zai/glm-5.2-reasoner") ||
1153 !strcmp(model, "glm-5.3-flash-reasoner") ||
1154 !strcmp(model, "zai/glm-5.3-flash-reasoner"));
1155}
1156
1157static server_model_syntax server_model_syntax_for_engine(ds4_engine *engine) {
1158 return ds4_engine_is_glm_dsa(engine) ?
1159 SERVER_MODEL_SYNTAX_GLM : ds4_engine_is_deepseek41(engine) ?
1160 SERVER_MODEL_SYNTAX_DEEPSEEK41 : SERVER_MODEL_SYNTAX_DEEPSEEK;
1161}
1162
1163static const char *server_model_id_from_engine(ds4_engine *engine) {
1164 if (ds4_engine_is_deepseek41(engine)) return "deepseek-v4.1-flash";
1165 if (ds4_engine_is_glm53(engine)) return "glm-5.3-flash";
1166 if (ds4_engine_is_glm_dsa(engine)) return "glm-5.2";
1167 return ds4_engine_model_id(engine) == 1 ?
1168 "deepseek-v4-pro" : "deepseek-v4-flash";
1169}
1170
1171static bool server_model_alias_known(const char *id) {
1172 return id &&
1173 (!strcmp(id, "deepseek-v4-flash") ||
1174 !strcmp(id, "deepseek-v4.1-flash") ||
1175 !strcmp(id, "deepseek-v4-pro") ||

Callers 1

parse_messagesFunction · 0.85

Calls 7

json_wsFunction · 0.85
json_litFunction · 0.85
json_stringFunction · 0.85
parse_function_callFunction · 0.85
json_skip_valueFunction · 0.85
tool_calls_pushFunction · 0.85
tool_call_freeFunction · 0.85

Tested by

no test coverage detected