/** * Utility functions for EmbeddingService * @module @skillsmith/core/embeddings/embedding-utils */ /** * Check if fallback mode should be used based on environment */ export declare function shouldUseFallback(explicit?: boolean): boolean; /** * Generate a deterministic hash from text for mock embeddings. * Uses a simple but effective string hashing algorithm. */ export declare function hashText(text: string): number; /** * Generate deterministic mock embedding based on text content. * Produces consistent vectors for the same input text. */ export declare function generateMockEmbedding(text: string, dimension: number): Float32Array; /** * Lazily load the @huggingface/transformers module. * Uses dynamic import so the module is not loaded at CLI startup. */ export declare function loadTransformersModule(): Promise; /** * Check if the transformers module is available without loading it. * This is a synchronous check that returns the current known state. * * @returns true if module is loaded, false if loading failed, undefined if not yet attempted */ export declare function isTransformersAvailable(): boolean | undefined; /** * Check if embeddings functionality is available. * Attempts to load the transformers module if not yet loaded. * * @returns true if embeddings can be used, false otherwise */ export declare function checkTransformersAvailability(): Promise; /** * Get the error that occurred when loading the transformers module, if any. */ export declare function getTransformersLoadError(): Error | null; /** * Cosine similarity between two vectors of equal length. * * SMI-4577: extracted from `EmbeddingService.cosineSimilarity` so the brute- * force fallback in this module can call it directly without a class * instance, and to keep `index.ts` under the 500-line cap. * * @throws if vectors have different lengths * @returns 0 when either vector has zero magnitude */ export declare function cosineSimilarity(a: Float32Array, b: Float32Array): number; /** * Brute-force top-K nearest-neighbour search over an embedding map. Used as * the deterministic fallback when HNSW is unavailable or explicitly disabled. * * SMI-4577: extracted from `EmbeddingService.findSimilarBruteForce` so the * pure search algorithm doesn't need a class instance. The wrapper method on * `EmbeddingService` still exists for backwards compatibility. */ export declare function findSimilarBruteForceFromMap(embeddings: Map, queryEmbedding: Float32Array, topK: number): Array<{ skillId: string; score: number; }>; //# sourceMappingURL=embedding-utils.d.ts.map