diff options
| author | sigoden <sigoden@gmail.com> | 2023-03-09 15:30:39 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-09 15:30:39 +0800 |
| commit | 05d20f207fedf03c2a564438a0d44a2d85d4ed2d (patch) | |
| tree | eb7c9ae402632c5827cd4faa323b138510716f22 /src/repl/init.rs | |
| parent | c7eb261abc32ac4d6fc5364244a6246bcdc462d9 (diff) | |
| download | aichat-05d20f207fedf03c2a564438a0d44a2d85d4ed2d.tar.gz | |
feat: add remain tokens indicator and max tokens guard (#50)
Diffstat (limited to 'src/repl/init.rs')
| -rw-r--r-- | src/repl/init.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/repl/init.rs b/src/repl/init.rs index a14265c..faafd9d 100644 --- a/src/repl/init.rs +++ b/src/repl/init.rs @@ -135,7 +135,12 @@ impl Prompt for ReplPrompt { } fn render_prompt_right(&self) -> Cow<str> { - Cow::Borrowed("") + let config = self.0.lock(); + if let Some(conversation) = config.conversation.as_ref() { + conversation.reamind_tokens().to_string().into() + } else { + Cow::Borrowed("") + } } fn render_prompt_indicator(&self, _prompt_mode: reedline::PromptEditMode) -> Cow<str> { |
