llmforge
Version:
One API, every AI model, instant switching. Change from GPT-4 to Gemini to local models with a single config update. LLMForge is the lightweight, TypeScript-first solution for multi-provider AI applications with zero vendor lock-in.
27 lines (26 loc) • 1.08 kB
TypeScript
import { Content } from '../types';
export declare class ContentBuilder {
private contents;
static create(): ContentBuilder;
addTextMessage(text: string, role?: 'user' | 'model' | 'system'): ContentBuilder;
addConversationTurn(userText: string, modelText: string): ContentBuilder;
build(): Content[];
clear(): ContentBuilder;
getLastContent(): Content | undefined;
removeLastContent(): ContentBuilder;
static fromMessages(messages: Array<{
role: 'user' | 'model' | 'system';
text: string;
}>): Content[];
static textOnly(text: string, role?: 'user' | 'model' | 'system'): Content[];
}
export declare class FileEncoder {
static encodeFileToBase64(file: File): Promise<string>;
static encodeBufferToBase64(buffer: ArrayBuffer): Promise<string>;
static getMimeTypeFromFile(file: File): string;
static getMimeTypeFromExtension(filename: string): string;
}
export declare class MessageValidator {
static validateContent(content: Content): void;
static validateContents(contents: Content[]): void;
}