From 7f2210dbcab017ee30e8f95771e68494b4860c59 Mon Sep 17 00:00:00 2001 From: sigoden Date: Wed, 1 Nov 2023 10:28:54 +0800 Subject: refactor: clients/* and config.rs (#193) - add register_clients macro to make it easier to add a new client - no create_client_config, just add const PROMPTS - move ModelInfo from clients/ to config/ - model's max_tokens are optional - improve code quanity on config/mod.rs - add/use macro config_get_fn --- src/repl/prompt.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/repl/prompt.rs') diff --git a/src/repl/prompt.rs b/src/repl/prompt.rs index c73e586..7bed5e0 100644 --- a/src/repl/prompt.rs +++ b/src/repl/prompt.rs @@ -32,11 +32,7 @@ impl Prompt for ReplPrompt { } fn render_prompt_right(&self) -> Cow { - if self.config.read().session.is_none() { - Cow::Borrowed("") - } else { - self.config.read().get_reamind_tokens().to_string().into() - } + Cow::Owned(self.config.read().render_prompt_right()) } fn render_prompt_indicator(&self, _prompt_mode: reedline::PromptEditMode) -> Cow { -- cgit v1.2.3