diff --git a/lightrag/api/routers/query_routes.py b/lightrag/api/routers/query_routes.py index 567659f8..d79dbde1 100644 --- a/lightrag/api/routers/query_routes.py +++ b/lightrag/api/routers/query_routes.py @@ -222,7 +222,6 @@ def create_query_routes(rag, api_key: Optional[str] = None, top_k: int = 60): result = await rag.aquery_llm(request.query, param=param) async def stream_generator(): - # Extract references and LLM response from unified result references = result.get("data", {}).get("references", []) llm_response = result.get("llm_response", {}) diff --git a/lightrag/utils.py b/lightrag/utils.py index c72b6fd2..60542e43 100644 --- a/lightrag/utils.py +++ b/lightrag/utils.py @@ -230,10 +230,9 @@ class LightragPathFilter(logging.Filter): path = record.args[2] status = record.args[4] - # Filter out successful GET requests to filtered paths + # Filter out successful GET/POST requests to filtered paths if ( - method == "GET" - or method == "POST" + (method == "GET" or method == "POST") and (status == 200 or status == 304) and path in self.filtered_paths ):