@bobmatnyc/ai-code-review
Version:
A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter
48 lines (47 loc) • 1.58 kB
TypeScript
/**
* @fileoverview Anthropic tool calling handler implementation
*
* This module provides a tool calling handler specifically for Anthropic Claude models.
*/
import { ToolCallingHandler, FunctionToolDefinition, ToolCallResult } from './toolCalling';
/**
* Implementation of ToolCallingHandler for Anthropic models
*/
export declare class AnthropicToolCallingHandler implements ToolCallingHandler {
/**
* Prepare tool definitions for Anthropic API
* @param tools The tools to prepare
* @returns The tools formatted for Anthropic
*/
prepareTools(tools: FunctionToolDefinition[]): any[];
/**
* Process tool calls from Anthropic response
* @param data The Anthropic response data
* @returns Processed tool calls and response message
*/
processToolCallsFromResponse(data: any): {
toolCalls: Array<{
id?: string;
name: string;
arguments: any;
}>;
responseMessage: string;
};
/**
* Create a request with tool results for Anthropic
* @param conversation The conversation so far
* @param toolResults The results of the tool calls
* @returns The updated conversation
*/
createToolResultsRequest(conversation: Array<{
role: string;
content: string | null;
toolCalls?: any;
toolCallId?: string;
name?: string;
}>, toolResults: ToolCallResult[]): any;
}
/**
* Anthropic tool calling handler singleton instance
*/
export declare const anthropicToolCallingHandler: AnthropicToolCallingHandler;