增加开启了混合检索

This commit is contained in:
chentianrui
2024-08-22 17:06:28 +08:00
parent 59ef831a41
commit 4c1c67aa50
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -39,7 +39,8 @@ def makeDescriptionByEngine(sql_database:SQLDatabase):
return table_schema_objs
def get_Retriever(index,**kwargs):
bEnableHybrid = True if os.getenv("HYBRID_ENABLED",False) == True else False
strEnableHybrid = os.getenv("HYBRID_ENABLED",'False')
bEnableHybrid = True if strEnableHybrid is not None and strEnableHybrid.title() == 'True' else False
if bEnableHybrid:
alpha = float(os.getenv("HYBRID_ALPHA", "0.5"))
retriever = HybridRetriever(index,alpha = alpha,**kwargs)