summaryrefslogtreecommitdiffstats
path: root/src/repl
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-11-01 10:28:54 +0800
committerGitHub <noreply@github.com>2023-11-01 10:28:54 +0800
commit7f2210dbcab017ee30e8f95771e68494b4860c59 (patch)
tree7a0c7bdc8f6930e262bf8cfdc8ffbd57aa843e40 /src/repl
parent64202758ec8693dd18951c554728bb5c6b7e5eeb (diff)
downloadaichat-7f2210dbcab017ee30e8f95771e68494b4860c59.tar.gz
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
Diffstat (limited to 'src/repl')
-rw-r--r--src/repl/prompt.rs6
1 files changed, 1 insertions, 5 deletions
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<str> {
- 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<str> {