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

Function append_openai_usage_json

ds4_server.c:4948–4963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4946 free(tag);
4947 if (!name) return false;
4948 p = tag_end + 1;
4949
4950 buf args = {0};
4951 while (true) {
4952 p = skip_ascii_ws(p);
4953 if (!strncmp(p, invoke_end, strlen(invoke_end))) {
4954 p += strlen(invoke_end);
4955 break;
4956 }
4957 if (strncmp(p, param_start, strlen(param_start)) != 0) {
4958 free(name);
4959 buf_free(&args);
4960 return false;
4961 }
4962 tag_end = strchr(p, '>');
4963 if (!tag_end) {
4964 free(name);
4965 buf_free(&args);
4966 return false;

Callers 2

sse_usage_chunkFunction · 0.85
final_responseFunction · 0.85

Calls 2

clamp_usage_tokensFunction · 0.85
buf_printfFunction · 0.85

Tested by

no test coverage detected