diff options
| author | sigoden <sigoden@gmail.com> | 2023-10-30 10:36:08 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-30 10:36:08 +0800 |
| commit | b3e687943811fd48589d7030122c33c7e9867ec9 (patch) | |
| tree | ecd1d829420f928a7df4a46d7bab0db24cb66755 /src/config/role.rs | |
| parent | 44ea384ee59fafb76882e1d6687bc4cbc6d61611 (diff) | |
| download | aichat-b3e687943811fd48589d7030122c33c7e9867ec9.tar.gz | |
feat: deprecate prompt, remove `--prompt` and `.prompt` (#176)
Diffstat (limited to 'src/config/role.rs')
| -rw-r--r-- | src/config/role.rs | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/config/role.rs b/src/config/role.rs index fee989e..87aca5e 100644 --- a/src/config/role.rs +++ b/src/config/role.rs @@ -3,7 +3,6 @@ use super::message::{Message, MessageRole}; use anyhow::{Context, Result}; use serde::{Deserialize, Serialize}; -const TEMP_ROLE_NAME: &str = "temp"; const INPUT_PLACEHOLDER: &str = "__INPUT__"; #[derive(Debug, Clone, Deserialize, Serialize)] @@ -17,18 +16,6 @@ pub struct Role { } impl Role { - pub fn new(prompt: &str, temperature: Option<f64>) -> Self { - Self { - name: TEMP_ROLE_NAME.into(), - prompt: prompt.into(), - temperature, - } - } - - pub fn is_temp(&self) -> bool { - self.name == TEMP_ROLE_NAME - } - pub fn info(&self) -> Result<String> { let output = serde_yaml::to_string(&self) .with_context(|| format!("Unable to show info about role {}", &self.name))?; |
