UNPKG

@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.55 kB
/** * @fileoverview OpenAI tool calling handler implementation * * This module provides a tool calling handler specifically for OpenAI models. */ import { ToolCallingHandler, FunctionToolDefinition, ToolCallResult } from './toolCalling'; /** * Implementation of ToolCallingHandler for OpenAI models */ export declare class OpenAIToolCallingHandler implements ToolCallingHandler { /** * Prepare tool definitions for OpenAI API * @param tools The tools to prepare * @returns The tools formatted for OpenAI */ prepareTools(tools: FunctionToolDefinition[]): any[]; /** * Process tool calls from OpenAI response * @param data The OpenAI 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 OpenAI * @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; tool_calls?: any[]; tool_call_id?: string; name?: string; }>, toolResults: ToolCallResult[]): any; } /** * OpenAI tool calling handler singleton instance */ export declare const openAIToolCallingHandler: OpenAIToolCallingHandler;