UNPKG

@promptbook/google

Version:

Promptbook: Turn your company's scattered knowledge into AI ready books

43 lines (42 loc) 1.28 kB
/** * Segment representing parts of a chat message that contain either raw text or an image prompt. * * @private internal helper of `<ChatMessageItem/>` */ export type ImagePromptSegment = ImagePromptTextSegment | ImagePromptImageSegment; /** * Raw text segment that can be rendered as markdown. * * @private internal helper of `<ChatMessageItem/>` */ export type ImagePromptTextSegment = { type: 'text'; content: string; }; /** * Image prompt segment that needs to fire the image generation pipeline. * * @private internal helper of `<ChatMessageItem/>` */ export type ImagePromptImageSegment = { type: 'image'; /** * Accessible alt text provided by the agent. */ alt: string; /** * Prompt text that will be sent to the image generation API. */ prompt: string; }; /** * Splits a chat message into text and image prompt segments. * * @param content - Raw markdown string produced by the agent. * @returns Ordered list of segments that preserves the original message flow. * @private internal helper of `<ChatMessageItem/>` */ export declare function splitMessageContentByImagePrompts(content: string): ReadonlyArray<ImagePromptSegment>; /** * Note: [💞] Ignore a discrepancy between file name and entity name */