- Move RAG from Langchain to crewai

This commit is contained in:
Josako
2025-03-10 08:31:15 +01:00
parent e088ef7e4e
commit 4b43f96afe
5 changed files with 216 additions and 1 deletions

View File

@@ -27,9 +27,11 @@ class StandardRAGRetriever(BaseRetriever):
self.catalog_id = retriever.catalog_id
self.tenant_id = tenant_id
catalog = Catalog.query.get_or_404(self.catalog_id)
embedding_model = "mistral.mistral-embed"
self.embedding_model, self.embedding_model_class = get_embedding_model_and_class(self.tenant_id,
self.catalog_id,
catalog.embedding_model)
embedding_model)
self.similarity_threshold = retriever.configuration.get('es_similarity_threshold', 0.3)
self.k = retriever.configuration.get('es_k', 8)
self.tuning = retriever.tuning