Skip to main content

estimate_tokens_heuristic

Function
This function is defined in the context module.
Estimate tokens for a string using heuristic (4 chars ≈ 1 token).

Signature

def estimate_tokens_heuristic(text: &str) -> usize

Parameters

text
&str
required
No description available.

Returns

Returns
usize
The result of the operation.

Uses

  • average

Source

View on GitHub

praisonai/src/context/mod.rs at line 319