summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-12-19 20:37:53 +0800
committerGitHub <noreply@github.com>2023-12-19 20:37:53 +0800
commit6286251d320a7f512e49534c30b42452d30d93cc (patch)
treed2c08ea4ff1f48042666624ebbb821e3136854c5 /src/utils
parent3adfeb1ae7c22e54570df69053aa3db226733384 (diff)
downloadaichat-6286251d320a7f512e49534c30b42452d30d93cc.tar.gz
feat: support gemini (#273)
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index 8a80b23..bd9f381 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -94,4 +94,9 @@ mod tests {
assert_eq!(tokenize("😊 hello world"), ["😊", " hello", " world"]);
assert_eq!(tokenize("δΈ–η•Œ"), ["δΈ–", "η•Œ"]);
}
+
+ #[test]
+ fn test_count_tokens() {
+ assert_eq!(count_tokens("😊 hello world"), 4);
+ }
}