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.88 kB
/** * @fileoverview Anthropic client implementation using the abstract client interface. * * This module implements the Anthropic client using the abstract client base class. * It provides functionality for interacting with Anthropic's Claude models for code reviews. */ import { AbstractClient } from '../base'; import { ReviewType, ReviewResult, FileInfo, ReviewOptions } from '../../types/review'; import { ProjectDocs } from '../../utils/projectDocs'; /** * Anthropic client implementation */ export declare class AnthropicClient extends AbstractClient { protected apiKey: string; /** * 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 Anthropic 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>; }