Skip to main content

message_text_for_estimation

Function message_text_for_estimation 

Source
pub fn message_text_for_estimation(req: &ChatCompletionRequest) -> String
Expand description

Concatenate all message text parts from a request for token estimation.

Image/audio bytes are excluded — the result is passed to the caller’s tokenizer (e.g. tt_tokenize::estimate_tokens) so that tt-shared does not need to depend on tt-tokenize.