Keep whole lines from the start of text while the estimate stays within maxTokens. If even the first line is too large, it is cut by characters and marked with an ellipsis.
text
maxTokens
Keep whole lines from the start of
textwhile the estimate stays withinmaxTokens. If even the first line is too large, it is cut by characters and marked with an ellipsis.