diff options
| author | sigoden <sigoden@gmail.com> | 2024-03-27 08:11:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-27 08:11:00 +0800 |
| commit | 3180d1d48573a6e12bb955ea0f6a312f80020fe6 (patch) | |
| tree | 14425cc1babdf2821308c1b096d36db8d451357f /src/config/role.rs | |
| parent | 8da9fa5f4c24ace21fbf0d8d406db44fbc6537ab (diff) | |
| download | aichat-3180d1d48573a6e12bb955ea0f6a312f80020fe6.tar.gz | |
refactor: seperate temperature from role/session (#378)
Diffstat (limited to 'src/config/role.rs')
| -rw-r--r-- | src/config/role.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/config/role.rs b/src/config/role.rs index 8e4a20e..57da38c 100644 --- a/src/config/role.rs +++ b/src/config/role.rs @@ -89,6 +89,10 @@ For example if the prompt is "Hello world Python", you should return "print('Hel self.prompt.contains(INPUT_PLACEHOLDER) } + pub fn set_temperature(&mut self, value: Option<f64>) { + self.temperature = value; + } + pub fn complete_prompt_args(&mut self, name: &str) { self.name = name.to_string(); self.prompt = complete_prompt_args(&self.prompt, &self.name); |
