@gaiaverse/semantic-turning-point-detector
Version:
Detects key semantic turning points in conversations using recursive semantic distance analysis. Ideal for conversation analysis, dialogue segmentation, insight detection, and AI-assisted reasoning tasks.
19 lines • 879 B
TypeScript
import { LRUCache } from 'lru-cache';
/**
* Count tokens in a given string using OpenAI-compatible tokenization.
*
* @param text - The text to tokenize
* @param modelName - Optional model name to specify the tokenizer variant, though not used as the default is sufficient.
* @returns Number of tokens
*/
export declare function countTokens(text: string): number;
/**
* Generates an embedding for a given text using the OpenAI API
* This provides the vector representation for semantic distance calculation
*/
export declare function generateEmbedding(text: string, model?: string, cache?: LRUCache<string, Float32Array>): Promise<Float32Array>;
/**
* Creates a new LRU cache for embeddings with RAM limit
*/
export declare function createEmbeddingCache(ramLimitMB?: number, ttlSeconds?: number): LRUCache<string, Float32Array>;
//# sourceMappingURL=tokensUtil.d.ts.map