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

Function build_prompt

ds4_cli.c:412–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412static void token_printer_write_char(token_printer *p, char c) {
413 if (p->in_think) token_printer_set_grey(p);
414 fputc((unsigned char)c, p->fp);
415 p->last_output_newline = c == '\n';
416}
417
418static void token_printer_process(token_printer *p, const char *text, size_t len, bool finish) {
419 const char *think_open = "<think>";
420 const char *think_close = "</think>";
421 size_t total = p->pending_len + len;
422 char *buf = malloc(total ? total : 1);

Callers 1

run_generationFunction · 0.85

Calls 4

is_rendered_chat_promptFunction · 0.85
ds4_encode_chat_promptFunction · 0.85
cli_effective_think_modeFunction · 0.85

Tested by

no test coverage detected