diff options
| author | sigoden <sigoden@gmail.com> | 2023-10-28 21:39:17 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-28 21:39:17 +0800 |
| commit | bc44026ff8828f532e9eba138e2ba35f7c247271 (patch) | |
| tree | 98c55ad31a543ff3cd56e297751d32ee9ca960a7 /src/repl/mod.rs | |
| parent | 1575d441724a27854c8f9fe1510a47a3050ae28d (diff) | |
| download | aichat-bc44026ff8828f532e9eba138e2ba35f7c247271.tar.gz | |
feat: enhance session/conversation (#162)
* feat: enhance session/conversation
* updates
* updates
* cut version v0.9.0-rc2
* add .session name completion
Diffstat (limited to 'src/repl/mod.rs')
| -rw-r--r-- | src/repl/mod.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/repl/mod.rs b/src/repl/mod.rs index f498ab4..797519b 100644 --- a/src/repl/mod.rs +++ b/src/repl/mod.rs @@ -26,10 +26,10 @@ pub const REPL_COMMANDS: [(&str, &str); 15] = [ (".prompt", "Add a GPT prompt"), (".role", "Select a role"), (".clear role", "Clear the currently selected role"), - (".conversation", "Start a conversation."), - (".clear conversation", "End current conversation."), + (".session", "Start a session"), + (".clear session", "End current session"), (".copy", "Copy the last output to the clipboard"), - (".read", "Read the contents of a file into the prompt"), + (".read", "Read the contents of a file and submit"), (".edit", "Multi-line editing (CTRL+S to finish)"), (".history", "Print the history"), (".clear history", "Clear the history"), @@ -89,6 +89,7 @@ impl Repl { _ => {} } } + handler.handle(ReplCmd::EndSession)?; Ok(()) } @@ -111,7 +112,7 @@ impl Repl { print_now!("\n"); } Some("role") => handler.handle(ReplCmd::ClearRole)?, - Some("conversation") => handler.handle(ReplCmd::EndConversatoin)?, + Some("session") => handler.handle(ReplCmd::EndSession)?, _ => dump_unknown_command(), }, ".history" => { @@ -141,8 +142,8 @@ impl Repl { handler.handle(ReplCmd::Prompt(text))?; } } - ".conversation" => { - handler.handle(ReplCmd::StartConversation)?; + ".session" => { + handler.handle(ReplCmd::StartSession(args.map(|v| v.to_string())))?; } ".copy" => { handler.handle(ReplCmd::Copy)?; |
