/** * Cache Key Generation * * Generates deterministic SHA256 hash keys for API request caching. */ import type { CacheKeyComponents } from './types'; /** * Generate a deterministic cache key from request components. * * The key is a SHA256 hash of: service:model:normalized_payload * * @example * ```ts * const key = generateCacheKey({ * service: 'openai', * model: 'text-embedding-3-large', * payload: { input: ['hello', 'world'] } * }) * // Returns: '3a7bd3e2...' (64 char hex string) * ``` */ export declare function generateCacheKey(components: CacheKeyComponents): string; /** * Generate cache key for embedding requests. * Path: ai/openai//.json */ export declare function generateEmbeddingCacheKey(model: string, inputs: readonly string[]): string; /** * Generate cache key for classification requests. * Path: ai////.json * * Includes prompt signature so cache is invalidated when prompt.ts changes. */ export declare function generateClassifierCacheKey(provider: string, model: string, messages: readonly { readonly content: string; readonly messageId: number; }[]): string; /** * Generate cache key for place lookup requests. * Path: places//.json * * @param type - 'places' for Places API Text Search, 'geocode' for Geocoding API * @param query - The search query or address * @param regionBias - Optional region bias code */ export declare function generatePlaceLookupCacheKey(type: 'places' | 'geocode', query: string, regionBias?: string): string; /** * Generate cache key for geocoding requests. * @deprecated Use generatePlaceLookupCacheKey('geocode', ...) instead * Path: geo/google/.json */ export declare function generateGeocodeCacheKey(location: string, regionBias?: string): string; /** * Generate cache key for URL-based requests (scraping, fetching). * Creates readable filename: sanitized URL + short hash suffix. * Use with subdirectory 'web/' in cache path. */ export declare function generateUrlCacheKey(url: string): string; /** * Generate cache key for image requests. * Creates readable filename: sanitized query + short hash suffix. * Path: images//-.json * * @example * ```ts * generateImageCacheKey('pixabay', 'hiking mountains') * // Returns: 'images/pixabay/hiking_mountains-a1b2c3d4' * ``` */ export declare function generateImageCacheKey(source: string, query: string): string; /** * Generate filename for cached image files (originals and thumbnails). * Creates readable filename: first 36 chars of sanitized URL (without protocol) + 8 char hash. * * @example * ```ts * generateImageFilename('https://pixabay.com/photos/mountain-1234/') * // Returns: 'pixabay_com_photos_mountain-1234-a1b2c3d4.jpg' * ``` */ export declare function generateImageFilename(url: string): string; //# sourceMappingURL=key.d.ts.map