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

Function openai_function_schema_from_tool

ds4_server.c:1186–1214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1184 !strcmp(id, "glm-5.3-flash") ||
1185 !strcmp(id, "glm-5.3-flash-chat") ||
1186 !strcmp(id, "glm-5.3-flash-no-think") ||
1187 !strcmp(id, "glm-5.3-flash-nothink") ||
1188 !strcmp(id, "glm-5.3-flash-reasoner") ||
1189 !strcmp(id, "zai/glm-5.3-flash") ||
1190 !strcmp(id, "zai/glm-5.3-flash-chat") ||
1191 !strcmp(id, "zai/glm-5.3-flash-reasoner"));
1192}
1193
1194static void stop_list_clear(stop_list *stops) {
1195 for (int i = 0; i < stops->len; i++) free(stops->v[i]);
1196 stops->len = 0;
1197 stops->max_len = 0;
1198}
1199
1200static void stop_list_push(stop_list *stops, char *s) {
1201 if (!s || !s[0]) {
1202 free(s);
1203 return;
1204 }
1205 if (stops->len == stops->cap) {
1206 stops->cap = stops->cap ? stops->cap * 2 : 4;
1207 stops->v = xrealloc(stops->v, (size_t)stops->cap * sizeof(stops->v[0]));
1208 }
1209 size_t n = strlen(s);
1210 if (n > stops->max_len) stops->max_len = n;
1211 stops->v[stops->len++] = s;
1212}
1213
1214static bool parse_stop(const char **p, stop_list *out) {
1215 json_ws(p);
1216 stop_list_clear(out);
1217 if (**p == '"') {

Callers 1

parse_tools_valueFunction · 0.85

Calls 4

json_wsFunction · 0.85
json_stringFunction · 0.85
json_raw_valueFunction · 0.85
json_skip_valueFunction · 0.85

Tested by

no test coverage detected