UNPKG

@bobmatnyc/ai-code-review

Version:

A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter

69 lines (68 loc) 2.2 kB
/** * @fileoverview Core functions for model map operations */ import { Provider, ModelMapping, EnhancedModelMapping, ModelCategory, ProviderFeatures } from './types'; /** * Get the API name from a model key. */ export declare function getApiNameFromKey(modelKey: string): string; /** * Get the model mapping for a given key. */ export declare function getModelMapping(modelKey: string): ModelMapping | undefined; /** * Get all model keys for a provider. */ export declare function getModelsByProvider(provider: Provider): string[]; /** * Get the default models for a provider (excludes deprecated). */ export declare function getModels(provider: Provider): string[]; /** * Parse a model string into provider and model name. */ export declare function parseModelString(modelString: string): { provider: Provider; modelName: string; }; /** * Get the full model key from provider and model name. */ export declare function getFullModelKey(provider: Provider, modelName: string): string; /** * Check if a model supports tool calling. */ export declare function supportsToolCalling(modelKey: string): boolean; /** * Get enhanced model mapping with all metadata. */ export declare function getEnhancedModelMapping(modelKey: string): EnhancedModelMapping | undefined; /** * Validate a model key and check for deprecation. */ export declare function validateModelKey(modelKey: string): { isValid: boolean; error?: string; warning?: string; suggestion?: string; }; /** * Calculate cost for a model usage. */ export declare function calculateCost(modelKey: string, inputTokens: number, outputTokens: number): number | undefined; /** * Get models by category. */ export declare function getModelsByCategory(category: ModelCategory, excludeDeprecated?: boolean): string[]; /** * Get recommended model for code review tasks. */ export declare function getRecommendedModelForCodeReview(preferCostOptimized?: boolean): string; /** * Get provider feature information. */ export declare function getProviderFeatures(modelKey: string): ProviderFeatures | undefined; /** * Format cost as currency string. */ export declare function formatCost(cost: number): string;