@bobmatnyc/ai-code-review
Version:
A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter
59 lines (58 loc) • 2.04 kB
TypeScript
/**
* @fileoverview Anthropic tool calling functionality for architectural reviews.
*
* This module provides specialized functionality for handling tool calling in
* Anthropic API requests, particularly for architectural reviews. It includes
* the logic for processing tool call responses, executing tools, and formatting
* tool results for follow-up requests.
*/
import { ProjectDocs } from '../../utils/projectDocs';
import { FileInfo, ReviewOptions, ReviewResult } from '../../types/review';
/**
* Interface for tool call results
*/
interface ToolCallResult {
toolName: string;
result: any;
}
/**
* Create follow-up messages containing tool results
* @param previousMessages Previous conversation messages
* @param toolResults Results from tool executions
* @returns Updated messages array with tool results
*/
export declare function createToolResultsRequest(previousMessages: Array<{
role: string;
content: any;
}>, toolResults: ToolCallResult[]): Array<{
role: string;
content: any;
}>;
/**
* Process tool calls from the Anthropic API response
* @param responseData The API response data
* @returns Object containing tool calls and the response message
*/
export declare function processToolCallsFromResponse(responseData: any): {
toolCalls: Array<{
name: string;
arguments: any;
}>;
responseMessage: string;
};
/**
* Prepare tools for Anthropic API
* @param tools Array of tool definitions
* @returns Formatted tools for the Anthropic API
*/
export declare function prepareTools(tools: any[]): any[];
/**
* Generate an architectural review with tool calling
* @param files Array of file information
* @param projectName Project name
* @param projectDocs Project documentation
* @param options Review options
* @returns Promise resolving to the review result
*/
export declare function generateArchitecturalAnthropicReview(files: FileInfo[], projectName: string, projectDocs?: ProjectDocs | null, options?: ReviewOptions): Promise<ReviewResult>;
export {};