| |
|
|
| #pragma once |
|
|
| #include "common.h" |
|
|
| #include <functional> |
| #include <string> |
| #include <vector> |
|
|
| 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); |
|
|
| using completion_callback = std::function<std::vector<std::pair<std::string, size_t>>(std::string_view, size_t)>; |
| void set_completion_callback(completion_callback cb); |
|
|
| namespace spinner { |
| void start(); |
| void stop(); |
| } |
|
|
| |
| |
| |
| |
|
|
| LLAMA_COMMON_ATTRIBUTE_FORMAT(1, 2) |
| void log(const char * fmt, ...); |
|
|
| LLAMA_COMMON_ATTRIBUTE_FORMAT(1, 2) |
| void error(const char * fmt, ...); |
|
|
| void flush(); |
| } |
|
|