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

Function parse_stop

ds4_server.c:940–967  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

938 if (orders->len == orders->cap) {
939 orders->cap = orders->cap ? orders->cap * 2 : 8;
940 orders->v = xrealloc(orders->v, (size_t)orders->cap * sizeof(orders->v[0]));
941 }
942 orders->v[orders->len++] = order;
943}
944
945static const tool_schema_order *tool_schema_orders_find(const tool_schema_orders *orders, const char *name) {
946 int idx = tool_schema_orders_find_index(orders, name);
947 return idx >= 0 ? &orders->v[idx] : NULL;
948}
949
950static void request_init(request *r, req_kind kind, int max_tokens) {
951 memset(r, 0, sizeof(*r));
952 r->kind = kind;
953 r->api = API_OPENAI;
954 r->model_syntax = SERVER_MODEL_SYNTAX_DEEPSEEK;
955 r->model = xstrdup("deepseek-v4-flash");
956 r->max_tokens = max_tokens;
957 r->top_k = 0;
958 r->temperature = DS4_DEFAULT_TEMPERATURE;
959 r->top_p = DS4_DEFAULT_TOP_P;
960 r->min_p = DS4_DEFAULT_MIN_P;
961 r->think_mode = DS4_THINK_HIGH;
962}
963
964static bool parse_ignore_eos_value(const char **p, request *r) {
965 return p && r && json_bool(p, &r->ignore_eos);
966}
967
968static bool request_validate_ignore_eos(const request *r,
969 char *err, size_t errlen) {
970 if (!r || !r->ignore_eos) return true;

Calls 5

json_wsFunction · 0.85
stop_list_clearFunction · 0.85
json_stringFunction · 0.85
stop_list_pushFunction · 0.85
json_skip_valueFunction · 0.85