@bobmatnyc/ai-code-review
Version:
A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter
50 lines (49 loc) • 1.98 kB
TypeScript
/**
* @fileoverview Index file for token and cost estimators.
*
* This module exports all the estimator classes and interfaces.
*/
export type { CostInfo, TokenEstimator } from './baseEstimator';
export { AbstractTokenEstimator } from './abstractEstimator';
export { GeminiTokenEstimator } from './geminiEstimator';
export { AnthropicTokenEstimator } from './anthropicEstimator';
export { OpenAITokenEstimator } from './openaiEstimator';
export { OpenRouterTokenEstimator } from './openRouterEstimator';
export { EstimatorFactory } from './estimatorFactory';
import { CostInfo } from './baseEstimator';
/**
* Estimate the number of tokens in a text
* @param text Text to estimate tokens for
* @returns Estimated token count
*/
export declare function estimateTokenCount(text: string): number;
/**
* Calculate the cost for a given number of input and output tokens
* @param inputTokens Number of input tokens
* @param outputTokens Number of output tokens
* @param modelName Name of the model (optional)
* @returns Estimated cost in USD
*/
export declare function calculateCost(inputTokens: number, outputTokens: number, modelName?: string): number;
/**
* Format a cost value as a currency string
* @param cost Cost value in USD
* @returns Formatted cost string
*/
export declare function formatCost(cost: number): string;
/**
* Get cost information based on token counts
* @param inputTokens Number of input tokens
* @param outputTokens Number of output tokens
* @param modelName Name of the model (optional)
* @returns Cost information
*/
export declare function getCostInfo(inputTokens: number, outputTokens: number, modelName?: string): CostInfo;
/**
* Get cost information based on text
* @param inputText Input text
* @param outputText Output text
* @param modelName Name of the model (optional)
* @returns Cost information
*/
export declare function getCostInfoFromText(inputText: string, outputText: string, modelName?: string): CostInfo;