stynx-code-services 3.6.2

Service layer orchestrating provider calls and tool execution
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub trait TokenEstimator: Send + Sync {
    fn estimate_tokens(&self, text: &str) -> usize;
}

pub struct SimpleEstimator;

impl SimpleEstimator {
    pub fn new() -> Self {
        Self
    }
}

impl TokenEstimator for SimpleEstimator {
    fn estimate_tokens(&self, text: &str) -> usize {

        (text.len() + 3) / 4
    }
}