From fcdfeea54824c849a07b5826e8d234b5e7b37b1c Mon Sep 17 00:00:00 2001 From: sigoden Date: Tue, 11 Jun 2024 14:28:33 +0800 Subject: refactor: rename `function_matcher` to `selected_functions` (#583) --- src/config/session.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/config/session.rs') diff --git a/src/config/session.rs b/src/config/session.rs index a525af3..62ba93c 100644 --- a/src/config/session.rs +++ b/src/config/session.rs @@ -21,7 +21,7 @@ pub struct Session { #[serde(skip_serializing_if = "Option::is_none")] top_p: Option, #[serde(skip_serializing_if = "Option::is_none")] - function_matcher: Option, + selected_functions: Option, #[serde(skip_serializing_if = "Option::is_none")] save_session: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -139,8 +139,8 @@ impl Session { if let Some(top_p) = self.top_p() { data["top_p"] = top_p.into(); } - if let Some(function_matcher) = self.function_matcher() { - data["function_matcher"] = function_matcher.into(); + if let Some(selected_functions) = self.selected_functions() { + data["selected_functions"] = selected_functions.into(); } if let Some(save_session) = self.save_session() { data["save_session"] = save_session.into(); @@ -176,8 +176,8 @@ impl Session { items.push(("top_p", top_p.to_string())); } - if let Some(function_matcher) = self.function_matcher() { - items.push(("function_matcher", function_matcher)); + if let Some(selected_functions) = self.selected_functions() { + items.push(("selected_functions", selected_functions)); } if let Some(save_session) = self.save_session() { @@ -251,7 +251,7 @@ impl Session { self.model_id = role.model().id(); self.temperature = role.temperature(); self.top_p = role.top_p(); - self.function_matcher = role.function_matcher().map(|v| v.to_string()); + self.selected_functions = role.selected_functions(); self.model = role.model().clone(); self.role_name = role.name().to_string(); self.role_prompt = role.prompt().to_string(); @@ -418,8 +418,8 @@ impl RoleLike for Session { self.top_p } - fn function_matcher(&self) -> Option { - self.function_matcher.clone() + fn selected_functions(&self) -> Option { + self.selected_functions.clone() } fn set_model(&mut self, model: &Model) { @@ -444,9 +444,9 @@ impl RoleLike for Session { } } - fn set_function_matcher(&mut self, value: Option) { - if self.function_matcher != value { - self.function_matcher = value; + fn set_selected_functions(&mut self, value: Option) { + if self.selected_functions != value { + self.selected_functions = value; self.dirty = true; } } -- cgit v1.2.3