UNPKG

il2cpp-dump-analyzer-mcp

Version:

Agentic RAG system for analyzing IL2CPP dump.cs files from Unity games

74 lines (73 loc) 2.21 kB
import { Embeddings } from '@langchain/core/embeddings'; /** * A simple embedding implementation that uses TF-IDF like approach * with cosine similarity for retrieval. * * This is a lightweight alternative that doesn't require external models * or native dependencies. */ export declare class SimpleEmbeddings extends Embeddings { private vocabulary; private documentVectors; private dimensions; constructor(); /** * Create embeddings for an array of texts * @param texts Array of texts to embed * @returns Promise resolving to a 2D array of embeddings */ embedDocuments(texts: string[]): Promise<number[][]>; /** * Create an embedding for a single query text * @param text Text to embed * @returns Promise resolving to an embedding vector */ embedQuery(text: string): Promise<number[]>; /** * Get the dimensionality of the embeddings * @returns The number of dimensions in the embedding vectors */ getDimension(): number; /** * Find the most similar documents to a query * @param query Query text * @param k Number of results to return * @returns Array of document IDs and similarity scores */ findSimilarDocuments(query: string, k?: number): Promise<Array<[string, number]>>; /** * Build vocabulary from texts * @param texts Array of texts */ private buildVocabulary; /** * Convert text to vector * @param text Input text * @returns Vector representation */ private textToVector; /** * Tokenize text into words * @param text Input text * @returns Array of tokens */ private tokenize; /** * Get document frequency for a word * @param word Word to check * @returns Number of documents containing the word */ private getDocumentFrequency; /** * Generate a unique ID for a document * @param text Document text * @returns Unique ID */ private getDocumentId; /** * Convert sparse vector to fixed-size vector using hashing * @param sparseVector Sparse vector * @returns Fixed-size vector */ private hashVector; }