From ff284779d9757c128acaf690ddf64a87a986e413 Mon Sep 17 00:00:00 2001 From: sigoden Date: Mon, 17 Jun 2024 15:17:07 +0800 Subject: refactor: make `set max_output_tokens` work for role/session/bot (#609) --- src/config/role.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/config/role.rs') 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; fn top_p(&self) -> Option; fn functions_filter(&self) -> Option; @@ -229,6 +230,10 @@ impl RoleLike for Role { &self.model } + fn model_mut(&mut self) -> &mut Model { + &mut self.model + } + fn temperature(&self) -> Option { self.temperature } -- cgit v1.2.3