summaryrefslogtreecommitdiffstats
path: root/src/repl
diff options
context:
space:
mode:
Diffstat (limited to 'src/repl')
-rw-r--r--src/repl/handler.rs2
-rw-r--r--src/repl/init.rs7
-rw-r--r--src/repl/mod.rs2
3 files changed, 8 insertions, 3 deletions
diff --git a/src/repl/handler.rs b/src/repl/handler.rs
index b5651c3..30a75c5 100644
--- a/src/repl/handler.rs
+++ b/src/repl/handler.rs
@@ -63,7 +63,7 @@ impl ReplCmdHandler {
wg.wait();
let buffer = ret?;
self.config.lock().save_message(&input, &buffer)?;
- self.config.lock().record_conversation(&input, &buffer)?;
+ self.config.lock().save_conversation(&input, &buffer)?;
*self.reply.borrow_mut() = buffer;
}
ReplCmd::SetRole(name) => {
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> {
diff --git a/src/repl/mod.rs b/src/repl/mod.rs
index 9407bcf..661be75 100644
--- a/src/repl/mod.rs
+++ b/src/repl/mod.rs
@@ -22,7 +22,7 @@ pub const REPL_COMMANDS: [(&str, &str, bool); 12] = [
(".role", "Select a role", false),
(".clear role", "Clear the currently selected role", false),
(".conversation", "Start a conversation.", false),
- (".clear conversation", "End the conversation.", false),
+ (".clear conversation", "End current conversation.", false),
(".history", "Print the history", false),
(".clear history", "Clear the history", false),
(".editor", "Enter editor mode for multiline input", true),