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

Function kv_cache_file_size_fits

ds4_server.c:8666–8675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8664 const char *event_type = "response.completed";
8665 if (finish && !strcmp(finish, "error")) event_type = "response.failed";
8666 else if (finish && !strcmp(finish, "length")) event_type = "response.incomplete";
8667 const char *status = responses_status_for_finish(finish);
8668
8669 buf b = {0};
8670 buf_printf(&b,
8671 "{\"type\":\"%s\",\"response\":{\"id\":\"%s\","
8672 "\"object\":\"response\",\"created_at\":%ld,\"status\":\"%s\",\"model\":",
8673 event_type, st->response_id, created_at, status);
8674 json_escape(&b, r->model);
8675 if (!strcmp(event_type, "response.failed")) {
8676 buf_puts(&b, ",\"error\":{\"code\":\"server_error\","
8677 "\"message\":\"generation failed\"}");
8678 } else if (!strcmp(event_type, "response.incomplete")) {

Calls 1

Tested by 1