import OpenAI from "openai"; /** * Utility functions for the WhatsApp GPT bot */ export declare class Utils { /** * Downloads a media file from a URL to a temporary file * * @param url URL of the media file * @param extension Optional file extension (default: determined from URL) * @returns Path to the downloaded temporary file */ static downloadMedia(url: string, extension?: string): Promise; /** * Transcribes an audio file using OpenAI's Whisper API * * @param filePath Path to the audio file * @param openai OpenAI client instance * @returns Transcribed text */ static transcribeAudio(filePath: string, openai: OpenAI): Promise; /** * Trims conversation history to keep it within token limits * * @param messages Array of messages * @param maxMessages Maximum number of messages to keep * @param preserveSystem Whether to preserve the system message * @returns Trimmed message array */ static trimConversationHistory(messages: any[], maxMessages: number, preserveSystem?: boolean): any[]; /** * Estimates token usage for a conversation * Very rough estimate: ~4 chars per token * * @param messages Conversation messages * @returns Estimated token count */ static estimateTokens(messages: any[]): number; }