From b333b06772c89d96aacb5490d6a219fba7c09cc6 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Thu, 12 Feb 2026 20:57:17 +0100 Subject: Engage! --- llama.cpp/common/console.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 llama.cpp/common/console.h (limited to 'llama.cpp/common/console.h') diff --git a/llama.cpp/common/console.h b/llama.cpp/common/console.h new file mode 100644 index 0000000..fad6d39 --- /dev/null +++ b/llama.cpp/common/console.h @@ -0,0 +1,41 @@ +// Console functions + +#pragma once + +#include "common.h" + +#include + +enum display_type { + DISPLAY_TYPE_RESET = 0, + DISPLAY_TYPE_INFO, + DISPLAY_TYPE_PROMPT, + DISPLAY_TYPE_REASONING, + DISPLAY_TYPE_USER_INPUT, + DISPLAY_TYPE_ERROR +}; + +namespace console { + void init(bool use_simple_io, bool use_advanced_display); + void cleanup(); + void set_display(display_type display); + bool readline(std::string & line, bool multiline_input); + + namespace spinner { + void start(); + void stop(); + } + + // note: the logging API below output directly to stdout + // it can negatively impact performance if used on inference thread + // only use in in a dedicated CLI thread + // for logging in inference thread, use log.h instead + + LLAMA_COMMON_ATTRIBUTE_FORMAT(1, 2) + void log(const char * fmt, ...); + + LLAMA_COMMON_ATTRIBUTE_FORMAT(1, 2) + void error(const char * fmt, ...); + + void flush(); +} -- cgit v1.2.3