retrival_methods.py 549 B

12345678910111213141516
  1. from enum import Enum
  2. class RetrievalMethod(str, 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, RetrievalMethod.HYBRID_SEARCH}
  9. @staticmethod
  10. def is_support_fulltext_search(retrieval_method: str) -> bool:
  11. return retrieval_method in {RetrievalMethod.FULL_TEXT_SEARCH, RetrievalMethod.HYBRID_SEARCH}