@callmedayz/ai-prompt-toolkit
Version:
Professional AI prompt engineering toolkit with advanced template features, real-time dashboards, conditional logic, template inheritance, live monitoring, OpenRouter integration, and 310+ model support
158 lines • 4.39 kB
TypeScript
import { PromptTemplate } from './prompt-template';
import { OpenRouterClient } from './openrouter-client';
import { SupportedModel } from './types';
/**
* Supported image formats for multimodal prompts
*/
export type ImageFormat = 'jpeg' | 'jpg' | 'png' | 'gif' | 'webp' | 'bmp';
/**
* Image input for multimodal prompts
*/
export interface ImageInput {
data: string;
format: ImageFormat;
description?: string;
metadata?: {
width?: number;
height?: number;
size?: number;
source?: string;
};
}
/**
* Multimodal content that can include text and images
*/
export interface MultimodalContent {
text?: string;
images?: ImageInput[];
metadata?: Record<string, any>;
}
/**
* Configuration for multimodal prompts
*/
export interface MultimodalPromptOptions {
template: string;
variables?: Record<string, any>;
imageVariables?: Record<string, ImageInput | ImageInput[]>;
maxImages?: number;
imageProcessing?: {
resize?: {
width: number;
height: number;
};
quality?: number;
format?: ImageFormat;
};
escapeHtml?: boolean;
preserveWhitespace?: boolean;
}
/**
* Result of multimodal prompt rendering
*/
export interface MultimodalPromptResult {
text: string;
images: ImageInput[];
totalTokens: number;
estimatedCost?: number;
metadata: {
imageCount: number;
totalImageSize: number;
supportedModels: SupportedModel[];
};
}
/**
* Multimodal model capabilities
*/
export interface MultimodalCapabilities {
model: SupportedModel;
supportsImages: boolean;
maxImages: number;
maxImageSize: number;
supportedFormats: ImageFormat[];
maxResolution: {
width: number;
height: number;
};
costPerImage?: number;
costPerToken?: number;
}
/**
* Multimodal Prompt Template System
*/
export declare class MultimodalPromptTemplate {
private options;
private textTemplate;
constructor(options: MultimodalPromptOptions);
/**
* Render the multimodal prompt with text and images
*/
render(variables?: Record<string, any>, imageVariables?: Record<string, ImageInput | ImageInput[]>): MultimodalPromptResult;
/**
* Check if a model supports the given multimodal content
*/
static isModelSupported(model: SupportedModel, content: MultimodalContent): boolean;
/**
* Get multimodal capabilities for a specific model
*/
static getModelCapabilities(model: SupportedModel): MultimodalCapabilities;
/**
* Get all models that support multimodal input
*/
static getMultimodalModels(): SupportedModel[];
/**
* Recommend the best multimodal model for given content
*/
static recommendModel(content: MultimodalContent): {
model: SupportedModel;
reason: string;
confidence: number;
};
/**
* Create a multimodal prompt from text and images
*/
static create(text: string, images: ImageInput[], options?: Partial<MultimodalPromptOptions>): MultimodalPromptTemplate;
/**
* Convert a regular prompt template to multimodal
*/
static fromPromptTemplate(promptTemplate: PromptTemplate, images?: ImageInput[]): MultimodalPromptTemplate;
private processImages;
private getSupportedModels;
}
/**
* Multimodal Completion Service
*/
export declare class MultimodalCompletion {
private client;
private completion;
constructor(client: OpenRouterClient);
/**
* Generate completion for multimodal prompt
*/
complete(prompt: MultimodalPromptResult, model?: SupportedModel, options?: any): Promise<{
text: string;
model: SupportedModel;
usage: {
promptTokens: number;
completionTokens: number;
totalTokens: number;
};
cost?: number;
}>;
private selectBestModel;
private formatPromptForAPI;
}
/**
* Utility functions for multimodal prompts
*/
/**
* Create an image input from a file path or URL
*/
export declare function createImageInput(source: string, description?: string): Promise<ImageInput>;
/**
* Validate image input
*/
export declare function validateImageInput(image: ImageInput): {
isValid: boolean;
errors: string[];
};
//# sourceMappingURL=multimodal-prompt.d.ts.map