Skip to main content

estimate_response_tokens

Function estimate_response_tokens 

Source
pub fn estimate_response_tokens(output: &FetchOutput) -> usize
Expand description

Rough token estimate of the serialized output — i.e. of the payload an MCP client actually receives (pretty JSON, matching crate::mcp’s emission). Uses the same ceil(chars / 4) heuristic as per-item content estimates.