truncateToTokenBudget
function truncateToTokenBudget(text, maxTokens): string;Truncates a text string to fit within a token budget. Truncation is at the nearest sentence boundary when possible.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”string