@promptbook/openai
Version:
Promptbook: Turn your company's scattered knowledge into AI ready books
21 lines (20 loc) • 809 B
TypeScript
/**
* Simplifies knowledge labels for UI chips by:
* - extracting filename from URL/path-like values,
* - removing extension,
* - removing trailing random ID segment when detected,
* - truncating to 20 characters with ellipsis.
*
* @param label - Raw knowledge label or source value.
* @returns Display-friendly chip label.
* @private utility of knowledge/source chip rendering
*/
export declare function simplifyKnowledgeLabel(label: string): string;
/**
* Heuristic that classifies a short text as human-readable, identifier-like, or unknown.
*
* @param text - Candidate value (typically a filename segment).
* @returns `'HUMAN'`, `'ID'`, or `'UNKNOWN'`.
* @private utility of knowledge/source chip rendering
*/
export declare function isHumanOrID(text: string): 'HUMAN' | 'ID' | 'UNKNOWN';