diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-17 15:17:07 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-17 15:17:07 +0800 |
| commit | ff284779d9757c128acaf690ddf64a87a986e413 (patch) | |
| tree | 36d687eef35d04b3a57014b97a820b7112986a01 /src/config/role.rs | |
| parent | ba884c9fc65d820f8603859acafd055b98897b56 (diff) | |
| download | aichat-ff284779d9757c128acaf690ddf64a87a986e413.tar.gz | |
refactor: make `set max_output_tokens` work for role/session/bot (#609)
Diffstat (limited to 'src/config/role.rs')
| -rw-r--r-- | src/config/role.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/config/role.rs b/src/config/role.rs index 4ff05b4..0dbfa00 100644 --- a/src/config/role.rs +++ b/src/config/role.rs @@ -18,6 +18,7 @@ pub const INPUT_PLACEHOLDER: &str = "__INPUT__"; pub trait RoleLike { fn to_role(&self) -> Role; fn model(&self) -> &Model; + fn model_mut(&mut self) -> &mut Model; fn temperature(&self) -> Option<f64>; fn top_p(&self) -> Option<f64>; fn functions_filter(&self) -> Option<FunctionsFilter>; @@ -229,6 +230,10 @@ impl RoleLike for Role { &self.model } + fn model_mut(&mut self) -> &mut Model { + &mut self.model + } + fn temperature(&self) -> Option<f64> { self.temperature } |
