We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export class RAGEmbedding { static singleton; static async init(embeddingModel) { if (!this.singleton) { await embeddingModel.init(); this.singleton = new RAGEmbedding(embeddingModel); } } static getInstance() { return RAGEmbedding.singleton; } static getEmbedding() { return RAGEmbedding.getInstance().embedding; } static translateChunks(chunks) { return chunks.map((chunk) => { return { pageContent: chunk.pageContent, metadata: chunk.metadata, }; }); } embedding; constructor(embeddingModel) { this.embedding = embeddingModel; } } //# sourceMappingURL=rag-embedding.js.map
The singleton pattern can cause problems when using multiple APIs
API1: openai API2: ollama
First embedding text with ollama, then, embedding will always use ollama, never use openai
The text was updated successfully, but these errors were encountered:
adhityan
No branches or pull requests
🐛 Describe the bug
The singleton pattern can cause problems when using multiple APIs
API1: openai
API2: ollama
First embedding text with ollama, then, embedding will always use ollama, never use openai
The text was updated successfully, but these errors were encountered: