UNPKG

@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

111 lines 3.05 kB
import { OpenRouterClient } from './openrouter-client'; import { SupportedModel } from './types'; /** * Test result for a single prompt-model combination */ export interface ModelTestResult { model: SupportedModel; prompt: string; success: boolean; response?: string; error?: string; latency: number; tokenUsage?: { promptTokens: number; completionTokens: number; totalTokens: number; }; cost?: number; finishReason?: string; } /** * Batch test results for multiple models */ export interface BatchTestResult { prompt: string; results: ModelTestResult[]; summary: { totalTests: number; successful: number; failed: number; averageLatency: number; totalCost: number; }; } /** * Model validation result */ export interface ModelValidationResult { model: SupportedModel; isAvailable: boolean; isWorking: boolean; error?: string; testResponse?: string; latency?: number; } /** * Service for testing and validating AI models through OpenRouter */ export declare class ModelTestingService { private completion; private client; constructor(client: OpenRouterClient); /** * Test a single prompt against a specific model */ testModel(prompt: string, model: SupportedModel, options?: { maxTokens?: number; temperature?: number; timeout?: number; }): Promise<ModelTestResult>; /** * Test a prompt against multiple models */ testMultipleModels(prompt: string, models: SupportedModel[], options?: { maxTokens?: number; temperature?: number; concurrent?: boolean; }): Promise<BatchTestResult>; /** * Validate that a model is available and working */ validateModel(model: SupportedModel): Promise<ModelValidationResult>; /** * Validate multiple models */ validateMultipleModels(models: SupportedModel[]): Promise<ModelValidationResult[]>; /** * Find the best performing model for a given prompt */ findBestModel(prompt: string, models: SupportedModel[], criteria?: { prioritizeSpeed?: boolean; prioritizeCost?: boolean; prioritizeQuality?: boolean; maxLatency?: number; maxCost?: number; }): Promise<{ bestModel: SupportedModel; reason: string; testResult: ModelTestResult; allResults: ModelTestResult[]; }>; /** * Run a comprehensive model health check */ runHealthCheck(models?: SupportedModel[]): Promise<{ timestamp: string; totalModels: number; healthyModels: number; unhealthyModels: number; results: ModelValidationResult[]; }>; /** * Create testing service from API key */ static fromApiKey(apiKey: string): ModelTestingService; /** * Create testing service from environment */ static fromEnv(): ModelTestingService; } //# sourceMappingURL=model-testing-service.d.ts.map