diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-23 19:31:29 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-23 19:31:29 +0800 |
| commit | 777638049b7ea4187b152d70ccc9d38d91948b2e (patch) | |
| tree | bfa93850191b63159b36c03c45e0a188ef6c2c4b /src | |
| parent | 6d148c9c53cd4ac7849f52b956aba87e84cc3d4d (diff) | |
| download | aichat-777638049b7ea4187b152d70ccc9d38d91948b2e.tar.gz | |
refactor: minor improvement (#638)
Diffstat (limited to 'src')
| -rw-r--r-- | src/config/mod.rs | 2 | ||||
| -rw-r--r-- | src/config/role.rs | 1 | ||||
| -rw-r--r-- | src/repl/mod.rs | 12 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index 2bc8d5f..4c0e1e7 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -75,7 +75,7 @@ And answer according to the language of the user's question. Given the context information, answer the query. Query: __INPUT__"#; -const LEFT_PROMPT: &str = "{color.green}{?session {?agent {agent}#}{session}{?role /}}{!session {?agent {agent}}}{role}{?rag @{rag}}{color.cyan}{?session )}{!session >}{color.reset} "; +const LEFT_PROMPT: &str = "{color.green}{?session {?agent {agent}>}{session}{?role /}}{!session {?agent {agent}>}}{role}{?rag @{rag}}{color.cyan}{?session )}{!session >}{color.reset} "; const RIGHT_PROMPT: &str = "{color.purple}{?session {?consume_tokens {consume_tokens}({consume_percent}%)}{!consume_tokens {consume_tokens}}}{color.reset}"; #[derive(Debug, Clone, Deserialize)] diff --git a/src/config/role.rs b/src/config/role.rs index 0dbfa00..29d3f3b 100644 --- a/src/config/role.rs +++ b/src/config/role.rs @@ -247,7 +247,6 @@ impl RoleLike for Role { } fn set_model(&mut self, model: &Model) { - self.model_id = Some(model.id()); self.model = model.clone(); } diff --git a/src/repl/mod.rs b/src/repl/mod.rs index 1df3fdb..8083820 100644 --- a/src/repl/mod.rs +++ b/src/repl/mod.rs @@ -123,7 +123,7 @@ lazy_static! { "Include files with the message", AssertState::pass() ), - ReplCommand::new(".continue", "Continue response", AssertState::pass()), + ReplCommand::new(".continue", "Continue the response", AssertState::pass()), ReplCommand::new( ".regenerate", "Regenerate the last response", @@ -443,6 +443,16 @@ Type ".help" for additional help. KeyCode::Enter, ReedlineEvent::Edit(vec![EditCommand::InsertNewline]), ); + keybindings.add_binding( + KeyModifiers::SHIFT, + KeyCode::Enter, + ReedlineEvent::Edit(vec![EditCommand::InsertNewline]), + ); + keybindings.add_binding( + KeyModifiers::ALT, + KeyCode::Enter, + ReedlineEvent::Edit(vec![EditCommand::InsertNewline]), + ); } fn create_edit_mode(config: &GlobalConfig) -> Box<dyn EditMode> { |
