diff options
| author | sigoden <sigoden@gmail.com> | 2023-11-07 23:07:42 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-07 23:07:42 +0800 |
| commit | c99bd015aa6ede7d306838c71d0ad6b89950a56b (patch) | |
| tree | a492524f1704f51215faba296516fc4c1c827dae /src/config/mod.rs | |
| parent | c256b6bae56c714adb7182bdbd02a74c27fd6b2d (diff) | |
| download | aichat-c99bd015aa6ede7d306838c71d0ad6b89950a56b.tar.gz | |
feat: temporarily use a role to send a message (#227)
Diffstat (limited to 'src/config/mod.rs')
| -rw-r--r-- | src/config/mod.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index 3d4df7d..05c681b 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -344,7 +344,7 @@ impl Config { } pub fn sys_info(&self) -> Result<String> { - let path_info = |path: &Path| { + let display_path = |path: &Path| { let state = if path.exists() { "" } else { " ⚠️" }; format!("{}{state}", path.display()) }; @@ -355,6 +355,11 @@ impl Config { .wrap .clone() .map_or_else(|| String::from("no"), |v| v.to_string()); + let prelude = if self.prelude.is_empty() { + String::from("-") + } else { + self.prelude.clone() + }; let items = vec![ ("model", self.model.id()), ("temperature", temperature), @@ -365,10 +370,11 @@ impl Config { ("wrap_code", self.wrap_code.to_string()), ("light_theme", self.light_theme.to_string()), ("keybindings", self.keybindings.stringify().into()), - ("config_file", path_info(&Self::config_file()?)), - ("roles_file", path_info(&Self::roles_file()?)), - ("messages_file", path_info(&Self::messages_file()?)), - ("sessions_dir", path_info(&Self::sessions_dir()?)), + ("prelude", prelude), + ("config_file", display_path(&Self::config_file()?)), + ("roles_file", display_path(&Self::roles_file()?)), + ("messages_file", display_path(&Self::messages_file()?)), + ("sessions_dir", display_path(&Self::sessions_dir()?)), ]; let output = items .iter() |
