fix event loop conflict
This commit is contained in:
@@ -466,7 +466,6 @@ async def _build_local_query_context(
|
||||
text_chunks_db: BaseKVStorage[TextChunkSchema],
|
||||
query_param: QueryParam,
|
||||
):
|
||||
|
||||
results = await entities_vdb.query(query, top_k=query_param.top_k)
|
||||
|
||||
if not len(results):
|
||||
@@ -483,7 +482,7 @@ async def _build_local_query_context(
|
||||
{**n, "entity_name": k["entity_name"], "rank": d}
|
||||
for k, n, d in zip(results, node_datas, node_degrees)
|
||||
if n is not None
|
||||
]#what is this text_chunks_db doing. dont remember it in airvx. check the diagram.
|
||||
] # what is this text_chunks_db doing. dont remember it in airvx. check the diagram.
|
||||
use_text_units = await _find_most_related_text_unit_from_entities(
|
||||
node_datas, query_param, text_chunks_db, knowledge_graph_inst
|
||||
)
|
||||
@@ -928,7 +927,6 @@ async def hybrid_query(
|
||||
query_param,
|
||||
)
|
||||
|
||||
|
||||
if hl_keywords:
|
||||
high_level_context = await _build_global_query_context(
|
||||
hl_keywords,
|
||||
@@ -939,7 +937,6 @@ async def hybrid_query(
|
||||
query_param,
|
||||
)
|
||||
|
||||
|
||||
context = combine_contexts(high_level_context, low_level_context)
|
||||
|
||||
if query_param.only_need_context:
|
||||
@@ -1008,9 +1005,11 @@ def combine_contexts(high_level_context, low_level_context):
|
||||
|
||||
# Combine and deduplicate the entities
|
||||
combined_entities = process_combine_contexts(hl_entities, ll_entities)
|
||||
|
||||
|
||||
# Combine and deduplicate the relationships
|
||||
combined_relationships = process_combine_contexts(hl_relationships, ll_relationships)
|
||||
combined_relationships = process_combine_contexts(
|
||||
hl_relationships, ll_relationships
|
||||
)
|
||||
|
||||
# Combine and deduplicate the sources
|
||||
combined_sources = process_combine_contexts(hl_sources, ll_sources)
|
||||
@@ -1046,7 +1045,6 @@ async def naive_query(
|
||||
chunks_ids = [r["id"] for r in results]
|
||||
chunks = await text_chunks_db.get_by_ids(chunks_ids)
|
||||
|
||||
|
||||
maybe_trun_chunks = truncate_list_by_token_size(
|
||||
chunks,
|
||||
key=lambda x: x["content"],
|
||||
@@ -1077,4 +1075,4 @@ async def naive_query(
|
||||
.strip()
|
||||
)
|
||||
|
||||
return response
|
||||
return response
|
||||
|
Reference in New Issue
Block a user