chore: version up to 2.80.35 and package with experience memory
This commit is contained in:
@@ -252,3 +252,20 @@ export function truncationNotice(kind: GenerationStopKind): string {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Some local engines report `maxPredictedTokensReached` even when the visible
|
||||
* answer is short (for example after an internal retry or SDK stats mismatch).
|
||||
* Only show the "answer was cut off" notice when the generated answer actually
|
||||
* consumed most of the output budget.
|
||||
*/
|
||||
export function shouldShowTruncationNotice(
|
||||
kind: GenerationStopKind,
|
||||
outputTokens: number,
|
||||
maxOutputTokens: number
|
||||
): boolean {
|
||||
if (kind === 'context-overflow' || kind === 'error') return true;
|
||||
if (kind !== 'output-limit') return false;
|
||||
const threshold = Math.max(128, Math.floor(maxOutputTokens * 0.85));
|
||||
return outputTokens >= threshold;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user