From 24cd1d1da1c05fadfa087ea119e71c9bbbdf19b5 Mon Sep 17 00:00:00 2001 From: ulleo Date: Tue, 25 Nov 2025 18:13:15 +0800 Subject: [PATCH] fix: "Object of type datetime is not JSON serializable" error in mcp chat --- backend/apps/chat/task/llm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/apps/chat/task/llm.py b/backend/apps/chat/task/llm.py index 801cbf16..39ab5423 100644 --- a/backend/apps/chat/task/llm.py +++ b/backend/apps/chat/task/llm.py @@ -1047,7 +1047,7 @@ def run_task(self, in_chat: bool = True, stream: bool = True, if in_chat: yield 'data:' + orjson.dumps({'content': 'execute-success', 'type': 'sql-data'}).decode() + '\n\n' if not stream: - json_result['data'] = result.get('data') + json_result['data'] = get_chat_chart_data(_session, self.record.id) if finish_step.value <= ChatFinishStep.QUERY_DATA.value: if stream: