diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-22 06:54:03 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-22 06:54:03 +0800 |
| commit | d645046d2d729a55345e18f97fefcab545086f53 (patch) | |
| tree | ceef0afa1d693a827441bf2157ef7ecc9359d3ff /src/config/input.rs | |
| parent | 52cd3efd6c6588a957fd11d56580cb54ba868724 (diff) | |
| download | aichat-d645046d2d729a55345e18f97fefcab545086f53.tar.gz | |
refactor: rename bot to agent (#628)
Diffstat (limited to 'src/config/input.rs')
| -rw-r--r-- | src/config/input.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/config/input.rs b/src/config/input.rs index b9b1746..b0b0bd9 100644 --- a/src/config/input.rs +++ b/src/config/input.rs @@ -38,12 +38,12 @@ pub struct Input { rag_name: Option<String>, role: Role, with_session: bool, - with_bot: bool, + with_agent: bool, } impl Input { pub fn from_str(config: &GlobalConfig, text: &str, role: Option<Role>) -> Self { - let (role, with_session, with_bot) = resolve_role(&config.read(), role); + let (role, with_session, with_agent) = resolve_role(&config.read(), role); Self { config: config.clone(), text: text.to_string(), @@ -56,7 +56,7 @@ impl Input { rag_name: None, role, with_session, - with_bot, + with_agent, } } @@ -102,7 +102,7 @@ impl Input { } } - let (role, with_session, with_bot) = resolve_role(&config.read(), role); + let (role, with_session, with_agent) = resolve_role(&config.read(), role); Ok(Self { config: config.clone(), text: texts.join("\n"), @@ -115,7 +115,7 @@ impl Input { rag_name: None, role, with_session, - with_bot, + with_agent, }) } @@ -289,8 +289,8 @@ impl Input { } } - pub fn with_bot(&self) -> bool { - self.with_bot + pub fn with_agent(&self) -> bool { + self.with_agent } pub fn summary(&self) -> String { @@ -361,7 +361,7 @@ fn resolve_role(config: &Config, role: Option<Role>) -> (Role, bool, bool) { None => ( config.extract_role(), config.session.is_some(), - config.bot.is_some(), + config.agent.is_some(), ), } } |
