Files
llama.cpp/tools/server/webui/src/lib/utils/text.ts
T

7 lines
295 B
TypeScript
Raw Normal View History

/**
* Returns a shortened preview of the provided content capped at the given length.
* Appends an ellipsis when the content exceeds the maximum.
*/
export function getPreviewText(content: string, max = 150): string {
return content.length > max ? content.slice(0, max) + '...' : content;
}