@@ -397,6 +397,7 @@ async def local_query(
397397 text_chunks_db : BaseKVStorage [TextChunkSchema ],
398398 query_param : QueryParam ,
399399 global_config : dict ,
400+ history : list [dict ] = [],
400401) -> str :
401402 context = None
402403 use_model_func = global_config ["llm_model_func" ]
@@ -446,6 +447,7 @@ async def local_query(
446447 response = await use_model_func (
447448 query ,
448449 system_prompt = sys_prompt ,
450+ history_messages = history
449451 )
450452 if len (response ) > len (sys_prompt ):
451453 response = (
@@ -670,6 +672,7 @@ async def global_query(
670672 text_chunks_db : BaseKVStorage [TextChunkSchema ],
671673 query_param : QueryParam ,
672674 global_config : dict ,
675+ history : list [dict ] = [],
673676) -> str :
674677 context = None
675678 use_model_func = global_config ["llm_model_func" ]
@@ -723,6 +726,7 @@ async def global_query(
723726 response = await use_model_func (
724727 query ,
725728 system_prompt = sys_prompt ,
729+ history_messages = history
726730 )
727731 if len (response ) > len (sys_prompt ):
728732 response = (
@@ -916,6 +920,7 @@ async def hybrid_query(
916920 text_chunks_db : BaseKVStorage [TextChunkSchema ],
917921 query_param : QueryParam ,
918922 global_config : dict ,
923+ history : list [dict ] = [],
919924) -> str :
920925 low_level_context = None
921926 high_level_context = None
@@ -984,6 +989,7 @@ async def hybrid_query(
984989 response = await use_model_func (
985990 query ,
986991 system_prompt = sys_prompt ,
992+ history_messages = history
987993 )
988994 if len (response ) > len (sys_prompt ):
989995 response = (
@@ -1070,6 +1076,7 @@ async def naive_query(
10701076 text_chunks_db : BaseKVStorage [TextChunkSchema ],
10711077 query_param : QueryParam ,
10721078 global_config : dict ,
1079+ history : list [dict ] = [],
10731080):
10741081 use_model_func = global_config ["llm_model_func" ]
10751082 results = await chunks_vdb .query (query , top_k = query_param .top_k )
@@ -1094,6 +1101,7 @@ async def naive_query(
10941101 response = await use_model_func (
10951102 query ,
10961103 system_prompt = sys_prompt ,
1104+ history_messages = history
10971105 )
10981106
10991107 if len (response ) > len (sys_prompt ):
0 commit comments