Download api/core/rag/retrieval/retrieval_methods.py from ZHZ1024/dify: direct link, hf CLI and curl.
- Browser
- Download file 568 Bytes
-
https://huggingface.co/spaces/ZHZ1024/dify/resolve/main/api/core/rag/retrieval/retrieval_methods.py
- Command line
-
hf download hf://spaces/ZHZ1024/dify/api/core/rag/retrieval/retrieval_methods.py
-
curl -L -o retrieval_methods.py https://huggingface.co/spaces/ZHZ1024/dify/resolve/main/api/core/rag/retrieval/retrieval_methods.py
568 Bytes
| from enum import Enum | |
| class RetrievalMethod(Enum): | |
| SEMANTIC_SEARCH = "semantic_search" | |
| FULL_TEXT_SEARCH = "full_text_search" | |
| HYBRID_SEARCH = "hybrid_search" | |
| def is_support_semantic_search(retrieval_method: str) -> bool: | |
| return retrieval_method in {RetrievalMethod.SEMANTIC_SEARCH.value, RetrievalMethod.HYBRID_SEARCH.value} | |
| def is_support_fulltext_search(retrieval_method: str) -> bool: | |
| return retrieval_method in {RetrievalMethod.FULL_TEXT_SEARCH.value, RetrievalMethod.HYBRID_SEARCH.value} | |