Avoid unnecessary LLM response generation

This commit is contained in:
yangdx
2025-01-29 21:01:35 +08:00
parent c423f37f62
commit 4302c65a04

View File

@@ -1025,6 +1025,10 @@ async def _build_query_context(
[hl_relations_context, ll_relations_context],
[hl_text_units_context, ll_text_units_context],
)
# not necessary to use LLM to generate a response
if not entities_context.strip() and not relations_context.strip():
return None
return f"""
-----Entities-----
```csv