| 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 | |
| 1194 | static 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 | |
| 1200 | static 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 | |
| 1214 | static bool parse_stop(const char **p, stop_list *out) { |
| 1215 | json_ws(p); |
| 1216 | stop_list_clear(out); |
| 1217 | if (**p == '"') { |
no test coverage detected