summaryrefslogtreecommitdiffstats
path: root/src/function.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-06-11 14:28:33 +0800
committerGitHub <noreply@github.com>2024-06-11 14:28:33 +0800
commitfcdfeea54824c849a07b5826e8d234b5e7b37b1c (patch)
treedf87330d4de22b0aa12db58883c3036cadd9a2b9 /src/function.rs
parent861529374726609a56f6b8af1145a0df5c924dcc (diff)
downloadaichat-fcdfeea54824c849a07b5826e8d234b5e7b37b1c.tar.gz
refactor: rename `function_matcher` to `selected_functions` (#583)
Diffstat (limited to 'src/function.rs')
-rw-r--r--src/function.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/function.rs b/src/function.rs
index f16fe3f..068cee0 100644
--- a/src/function.rs
+++ b/src/function.rs
@@ -15,7 +15,7 @@ use std::{
path::Path,
};
-pub const FUNCTION_ALL_MATCHER: &str = ".*";
+pub const SELECTED_ALL_FUNCTIONS: &str = ".*";
pub type ToolResults = (Vec<ToolCallResult>, String);
pub type FunctionsFilter = String;
@@ -80,8 +80,8 @@ impl Functions {
})
}
- pub fn select(&self, matcher: &str) -> Option<Vec<FunctionDeclaration>> {
- let regex = Regex::new(&format!("^({matcher})$")).ok()?;
+ pub fn select(&self, filter: &FunctionsFilter) -> Option<Vec<FunctionDeclaration>> {
+ let regex = Regex::new(&format!("^({filter})$")).ok()?;
let output: Vec<FunctionDeclaration> = self
.declarations
.iter()