UNPKG

@promptbook/remote-client

Version:

Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action

50 lines (49 loc) 1.79 kB
/// <reference types="node" /> /// <reference types="node" /> import type { string_data_url } from '../../types/string_base64'; import type { string_filename } from '../../types/string_filename'; import type { string_knowledge_source_link } from '../../types/string_knowledge_source_content'; /** * Type describing inline knowledge source file. * * @private Internal representation of inline knowledge prepared for uploads. */ export type InlineKnowledgeSourceFile = { readonly filename: string_filename; readonly mimeType: string; readonly buffer: Buffer; }; /** * Function signature used to upload inline knowledge files to external storage. * * @private */ export type InlineKnowledgeSourceUploader = (file: InlineKnowledgeSourceFile) => Promise<string_knowledge_source_link>; /** * Converts inline knowledge into the internal metadata form used for uploads. * * @private */ export declare function createInlineKnowledgeSourceFile(content: string): InlineKnowledgeSourceFile; /** * Checks whether the provided source string is a data URL that can be decoded. * * @private thing of inline knowledge */ export declare function isDataUrlKnowledgeSource(source: string): source is string_data_url; /** * Converts a stored inline knowledge file into a data URL for backwards compatibility. * * @private */ export declare function inlineKnowledgeSourceToDataUrl(source: InlineKnowledgeSourceFile): string_knowledge_source_link; /** * Parses a data URL-based knowledge source into its raw buffer, filename, and MIME type. * * @private utility of inline knowledge processing */ export declare function parseDataUrlKnowledgeSource(source: string): { readonly buffer: Buffer; readonly filename: string_filename; readonly mimeType: string; } | null;