Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/AI45Lab/Code
/ estimate_tokens
Function
estimate_tokens
core/src/agent/context_perception.rs:284–286 ·
view source on GitHub ↗
(text: &str)
Source
from the content-addressed store, hash-verified
282
283
#[cfg(feature =
"ahp"
)]
284
fn estimate_tokens(text: &str) -> usize {
285
(text.len() / 4).max(1)
286
}
287
288
#[cfg(feature =
"ahp"
)]
289
fn ahp_context_result(
Callers
1
injected_context_to_results
Function · 0.70
Calls
1
len
Method · 0.45
Tested by
no test coverage detected