From 786aa92b48915f77f03e8872590d4f4ba97b7427 Mon Sep 17 00:00:00 2001 From: magicyuan876 <317617749@qq.com> Date: Fri, 6 Dec 2024 14:32:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(utils):=20=E4=BF=AE=E5=A4=8D=20JSON=20?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=BC=96=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 json.dumps 中添加 ensure_ascii=False 参数,以支持非 ASCII 字符编码 -这个修改确保了包含中文等非 ASCII 字符的日志信息能够正确处理和显示 --- lightrag/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/utils.py b/lightrag/utils.py index 70ec4341..4c8d7996 100644 --- a/lightrag/utils.py +++ b/lightrag/utils.py @@ -358,7 +358,7 @@ async def get_best_cached_response( "cache_id": best_cache_id, "original_prompt": prompt_display, } - logger.info(json.dumps(log_data)) + logger.info(json.dumps(log_data, ensure_ascii=False)) return best_response return None