/**
 * Token Counter
 *
 * Provides utilities for counting tokens in strings and messages.
 * Uses tiktoken for accuracy, with character-based fallback for robustness.
 */
/**
 * Simplified message structure for token counting.
 */
export interface TokenCounterMessage {
    /** Role of the message (system, user, assistant, tool). */
    role: string;
    /** Content of the message. Can be a string, null, or array of parts. */
    content: string | null | unknown[];
    /** Optional tool calls within the message. */
    tool_calls?: unknown[];
}
/**
 * Interface for token counting implementations.
 */
export interface TokenCounter {
    /** Counts tokens in a plain text string. */
    countTokens(text: string): number;
    /** Counts tokens in a list of conversation messages. */
    countMessageTokens(messages: TokenCounterMessage[]): number;
    /** Estimates token count for a streaming chunk. */
    estimateStreamingTokens(chunk: string): number;
    /** Releases resources used by the counter. */
    dispose(): void;
}
/**
 * Creates a token counter instance for a specific model.
 * Automatically handles fallbacks if tiktoken or specific model encodings are unavailable.
 *
 * @param model - The model name (e.g., 'gpt-4', 'gpt-3.5-turbo').
 * @returns A TokenCounter implementation.
 */
export declare function createTokenCounter(model?: string): TokenCounter;
/**
 * Count tokens in a text string
 * @param text - The text to count tokens in
 * @param model - The model to use for token counting (default: gpt-4)
 */
export declare function countTokens(text: string, model?: string): number;
/**
 * Count tokens in a single message
 * @param message - The message to count tokens in
 * @param model - The model to use for token counting (default: gpt-4)
 */
export declare function countMessageTokens(message: TokenCounterMessage, model?: string): number;
/**
 * Count tokens in multiple messages
 * @param messages - The messages to count tokens in
 * @param model - The model to use for token counting (default: gpt-4)
 */
export declare function countMessagesTokens(messages: TokenCounterMessage[], model?: string): number;
