import { Loggable } from '../logging'; import { Message } from "./base"; import { CreateChatCompletionResponse } from "openai"; export declare class ApiManager extends Loggable { totalTost: number; totalBudget: number; totalCompletionTokens: number; totalPromptTokens: number; reset(): void; /** * Create a chat completion and update the cost. * @param {Array} messages - The list of messages to send to the API. * @param {string} - The model to use for the API call. * @param {number} - The temperature to use for the API call. * @param {number} - The maximum number of tokens for the API call. * @returns {Promise} - The AI's response. */ createChatCompletion(options: { messages: Array; model: string; temperature?: number; max_tokens: number; }): Promise; /** * Update the total cost, prompt tokens, and completion tokens. * @param {number} promptTokens - The number of tokens used in the prompt. * @param {number} completionTokens - The number of tokens used in the completion. * @param {string} model - The model used for the API call. */ updateCost(promptTokens: number, completionTokens: number, model: string): void; /** * Sets the total user-defined budget for API calls. * @param {number} total_budget - The total budget for API calls. */ setTotalBudget(total_budget: number): void; /** * Get the total number of prompt tokens. * @returns {number} - The total number of prompt tokens. */ getTotalPromptTokens(): number; /** * Get the total number of completion tokens. * @returns {number} - The total number of completion tokens. */ getTotalCompletionTokens(): number; /** * Get the total cost of API calls. * @returns {number} - The total cost of API calls. */ getTotalCost(): number; getTotalBudget(): number; }