@bobmatnyc/ai-code-review
Version:
A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter
34 lines (33 loc) • 1.11 kB
TypeScript
/**
* @fileoverview Tokenizer implementation for Google Gemini models.
*
* This module provides a tokenizer implementation for Google Gemini models.
*
* Note: The Google Generative AI library doesn't currently expose a tokenizer,
* so we use a character-based approximation for now. This should be updated
* when Google provides an official tokenizer.
*/
import { Tokenizer } from './baseTokenizer';
/**
* Tokenizer for Google Gemini models
*/
export declare class GeminiTokenizer implements Tokenizer {
private modelPatterns;
/**
* Count the number of tokens in a text using an approximation for Gemini models
* @param text Text to count tokens for
* @returns Estimated token count
*/
countTokens(text: string): number;
/**
* Get the model name for this tokenizer
* @returns 'gemini'
*/
getModelName(): string;
/**
* Check if this tokenizer supports a given model
* @param modelName Name of the model to check
* @returns True if the model is supported, false otherwise
*/
supportsModel(modelName: string): boolean;
}