retrival_methods.py 568 B

123456789101112131415
  1. from enum import Enum
  2. class RetrievalMethod(Enum):
  3. SEMANTIC_SEARCH = 'semantic_search'
  4. FULL_TEXT_SEARCH = 'full_text_search'
  5. HYBRID_SEARCH = 'hybrid_search'
  6. @staticmethod
  7. def is_support_semantic_search(retrieval_method: str) -> bool:
  8. return retrieval_method in {RetrievalMethod.SEMANTIC_SEARCH.value, RetrievalMethod.HYBRID_SEARCH.value}
  9. @staticmethod
  10. def is_support_fulltext_search(retrieval_method: str) -> bool:
  11. return retrieval_method in {RetrievalMethod.FULL_TEXT_SEARCH.value, RetrievalMethod.HYBRID_SEARCH.value}