Skip to main content

estimate_code_mode_tokens

Function estimate_code_mode_tokens 

Source
pub fn estimate_code_mode_tokens(
    query: &str,
    records: &[&str],
    host_calls: usize,
) -> usize
Expand description

Estimate token cost of a code-mode exchange given the same query

  • records. Each host call costs ~4 tokens (function name + returned-memory pointer); records are streamed back uncompressed because the LLM sees them only when it decides to emit them.