@bobmatnyc/ai-code-review
Version:
A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter
70 lines (69 loc) • 2.94 kB
TypeScript
/**
* @fileoverview OpenRouter client implementation using the abstract client interface.
*
* This module implements the OpenRouter client using the abstract client base class.
* It provides functionality for interacting with OpenRouter's API, which gives access
* to a variety of AI models from different providers.
*/
import { AbstractClient } from '../base';
import { ReviewType, ReviewResult, FileInfo, ReviewOptions } from '../../types/review';
import { ProjectDocs } from '../../utils/projectDocs';
/**
* OpenRouter client implementation
*/
export declare class OpenRouterClient extends AbstractClient {
protected apiKey: string | undefined;
/**
* Initialize with default values
*/
constructor();
/**
* Check if the provided model name is supported by this client
* @param modelName The full model name (potentially with provider prefix)
* @returns Object indicating if this is the correct client for the model
*/
isModelSupported(modelName: string): {
isCorrect: boolean;
adapter: string;
modelName: string;
};
/**
* Get the provider name for this client
* @returns The provider name
*/
protected getProviderName(): string;
/**
* Initialize the OpenRouter client
* @returns Promise resolving to a boolean indicating success
*/
initialize(): Promise<boolean>;
/**
* Generate a review for a single file
* @param fileContent Content of the file to review
* @param filePath Path to the file
* @param reviewType Type of review to perform
* @param projectDocs Optional project documentation
* @param options Review options
* @returns Promise resolving to the review result
*/
generateReview(fileContent: string, filePath: string, reviewType: ReviewType, projectDocs?: ProjectDocs | null, options?: ReviewOptions): Promise<ReviewResult>;
/**
* Generate a consolidated review for multiple files
* @param files Array of file information objects
* @param projectName Name of the project
* @param reviewType Type of review to perform
* @param projectDocs Optional project documentation
* @param options Review options
* @returns Promise resolving to the review result
*/
generateConsolidatedReview(files: FileInfo[], projectName: string, reviewType: ReviewType, projectDocs?: ProjectDocs | null, options?: ReviewOptions): Promise<ReviewResult>;
/**
* Generate an architectural review for a project
* @param files Array of file information objects
* @param projectName Name of the project
* @param projectDocs Optional project documentation
* @param options Review options
* @returns Promise resolving to the review result
*/
generateArchitecturalReview(files: FileInfo[], projectName: string, projectDocs?: ProjectDocs | null, options?: ReviewOptions): Promise<ReviewResult>;
}