summaryrefslogtreecommitdiffstats
path: root/src/config/role.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/role.rs')
-rw-r--r--src/config/role.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/config/role.rs b/src/config/role.rs
index 829c0d1..fedcb1e 100644
--- a/src/config/role.rs
+++ b/src/config/role.rs
@@ -26,11 +26,10 @@ static RE_METADATA: LazyLock<Regex> =
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 use_tools(&self) -> Option<String>;
- fn set_model(&mut self, model: &Model);
+ fn set_model(&mut self, model: Model);
fn set_temperature(&mut self, value: Option<f64>);
fn set_top_p(&mut self, value: Option<f64>);
fn set_use_tools(&mut self, value: Option<String>);
@@ -176,7 +175,7 @@ impl Role {
top_p: Option<f64>,
use_tools: Option<String>,
) {
- self.set_model(model);
+ self.set_model(model.clone());
if temperature.is_some() {
self.set_temperature(temperature);
}
@@ -269,10 +268,6 @@ impl RoleLike for Role {
&self.model
}
- fn model_mut(&mut self) -> &mut Model {
- &mut self.model
- }
-
fn temperature(&self) -> Option<f64> {
self.temperature
}
@@ -285,11 +280,11 @@ impl RoleLike for Role {
self.use_tools.clone()
}
- fn set_model(&mut self, model: &Model) {
+ fn set_model(&mut self, model: Model) {
if !self.model().id().is_empty() {
self.model_id = Some(model.id().to_string());
}
- self.model = model.clone();
+ self.model = model;
}
fn set_temperature(&mut self, value: Option<f64>) {