Merge branch 'HKUDS:main' into main

This commit is contained in:
IcySugar
2025-04-09 13:40:19 +08:00
committed by GitHub
6 changed files with 21 additions and 8 deletions

View File

@@ -1072,7 +1072,14 @@ async def mix_kg_vector_query(
return PROMPTS["fail_response"]
if query_param.only_need_context:
return {"kg_context": kg_context, "vector_context": vector_context}
context_str = f"""
-----Knowledge Graph Context-----
{kg_context if kg_context else "No relevant knowledge graph information found"}
-----Vector Context-----
{vector_context if vector_context else "No relevant text information found"}
""".strip()
return context_str
# 5. Construct hybrid prompt
sys_prompt = (