@promptbook/openai
Version:
Promptbook: Turn your company's scattered knowledge into AI ready books
39 lines (38 loc) • 1.65 kB
TypeScript
import { ChatParticipant } from '../types/ChatParticipant';
import type { ParsedCitation } from './parseCitationsFromContent';
/**
* Returns whether the provided value is a valid HTTP(S) URL.
*
* @param value - Candidate string to inspect.
* @returns True when the value parses as an HTTP or HTTPS URL.
* @private utility of `<Chat/>` citation rendering
*/
export declare function isCitationUrl(value: string): boolean;
/**
* Determines whether a citation should be displayed as a text snippet instead of a file/URL.
*
* @param citation - Parsed citation metadata.
* @returns True when the citation looks like inline text instead of a document or URL.
* @private utility of `<Chat/>` citation rendering
*/
export declare function isPlainTextCitation(citation: ParsedCitation): boolean;
/**
* Builds a label that matches the desired chip/modal title for a citation.
*
* @param citation - Parsed citation metadata.
* @returns The friendly label shown on chips and modal headers.
* @private utility of `<Chat/>` citation rendering
*/
export declare function getCitationLabel(citation: ParsedCitation): string;
/**
* Resolves the preview URL used inside the citation modal iframe.
*
* @param citation - Parsed citation metadata.
* @param participants - Known chat participants for agent knowledge lookup.
* @returns URL string suitable for iframe preview or null when unavailable.
* @private utility of `<Chat/>` citation rendering
*/
export declare function resolveCitationPreviewUrl(citation: ParsedCitation, participants: ReadonlyArray<ChatParticipant>): string | null;
/**
* TODO: [💞] Spread into multiple files
*/