Langchain-Chatchat/libs/chatchat-server/chatchat/server/file_rag/utils.py

17 lines
446 B
Python
Raw Normal View History

2024-12-20 16:04:03 +08:00
from chatchat.server.file_rag.retrievers import (
BaseRetrieverService,
EnsembleRetrieverService,
VectorstoreRetrieverService,
MilvusVectorstoreRetrieverService,
)
Retrivals = {
"milvusvectorstore": MilvusVectorstoreRetrieverService,
"vectorstore": VectorstoreRetrieverService,
"ensemble": EnsembleRetrieverService,
}
def get_Retriever(type: str = "vectorstore") -> BaseRetrieverService:
return Retrivals[type]