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

17 lines
446 B
Python

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]