diff options
| author | sigoden <sigoden@gmail.com> | 2024-11-03 08:07:46 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-03 08:07:46 +0800 |
| commit | 6b77890ec400090caa5d9fa3bffee0db91c9adfc (patch) | |
| tree | 1982f43443034bdd84bbafb5a3365ae50852d5a4 /src/repl | |
| parent | f5cdd0f136d1d5ba9944135f714edf3979bb7d45 (diff) | |
| download | aichat-6b77890ec400090caa5d9fa3bffee0db91c9adfc.tar.gz | |
feat: support `.edit rag-docs` (#964)
Diffstat (limited to 'src/repl')
| -rw-r--r-- | src/repl/mod.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/repl/mod.rs b/src/repl/mod.rs index c08afc3..7bf70ea 100644 --- a/src/repl/mod.rs +++ b/src/repl/mod.rs @@ -31,7 +31,7 @@ lazy_static::lazy_static! { const MENU_NAME: &str = "completion_menu"; lazy_static::lazy_static! { - static ref REPL_COMMANDS: [ReplCommand; 34] = [ + static ref REPL_COMMANDS: [ReplCommand; 35] = [ ReplCommand::new(".help", "Show this help message", AssertState::pass()), ReplCommand::new(".info", "View system info", AssertState::pass()), ReplCommand::new(".model", "Change the current LLM", AssertState::pass()), @@ -106,6 +106,11 @@ lazy_static::lazy_static! { AssertState::False(StateFlags::AGENT) ), ReplCommand::new( + ".edit rag-docs", + "Edit the RAG documents", + AssertState::True(StateFlags::RAG), + ), + ReplCommand::new( ".rebuild rag", "Rebuild the RAG to sync document changes", AssertState::True(StateFlags::RAG), @@ -360,8 +365,11 @@ impl Repl { Some(("session", _)) => { self.config.write().edit_session()?; } + Some(("rag-docs", _)) => { + Config::edit_rag_docs(&self.config, self.abort_signal.clone()).await?; + } _ => { - println!(r#"Usage: .edit <role|session>"#) + println!(r#"Usage: .edit <role|session|rag-docs>"#) } } } |
