| 
									
										
										
										
											2024-06-19 16:05:27 +08:00
										 |  |  | from enum import Enum | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-16 19:09:04 +08:00
										 |  |  | class RetrievalMethod(Enum): | 
					
						
							| 
									
										
										
										
											2024-09-10 17:00:20 +08:00
										 |  |  |     SEMANTIC_SEARCH = "semantic_search" | 
					
						
							|  |  |  |     FULL_TEXT_SEARCH = "full_text_search" | 
					
						
							|  |  |  |     HYBRID_SEARCH = "hybrid_search" | 
					
						
							| 
									
										
										
										
											2024-06-19 16:05:27 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @staticmethod | 
					
						
							|  |  |  |     def is_support_semantic_search(retrieval_method: str) -> bool: | 
					
						
							| 
									
										
										
										
											2024-07-16 19:09:04 +08:00
										 |  |  |         return retrieval_method in {RetrievalMethod.SEMANTIC_SEARCH.value, RetrievalMethod.HYBRID_SEARCH.value} | 
					
						
							| 
									
										
										
										
											2024-06-19 16:05:27 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @staticmethod | 
					
						
							|  |  |  |     def is_support_fulltext_search(retrieval_method: str) -> bool: | 
					
						
							| 
									
										
										
										
											2024-07-16 19:09:04 +08:00
										 |  |  |         return retrieval_method in {RetrievalMethod.FULL_TEXT_SEARCH.value, RetrievalMethod.HYBRID_SEARCH.value} |