From 37c0eb1a4761efa13a943eb94bbaa4c7b10691ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=BD=AE?= Date: Mon, 16 Feb 2026 00:08:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi_app.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fastapi_app.py b/fastapi_app.py index 5e88bb7..2466f16 100644 --- a/fastapi_app.py +++ b/fastapi_app.py @@ -6,6 +6,16 @@ import multiprocessing import sys from contextlib import asynccontextmanager +# ========== 抑制第三方库的 Pydantic 警告 ========== +# langgraph-checkpoint-postgres 等库使用 typing.NotRequired 导致的警告 +import warnings +warnings.filterwarnings( + "ignore", + message=".*typing.NotRequired is not a Python type.*", + category=UserWarning +) +# ========== End 抑制警告 ========== + # ========== Monkey patch: 必须在所有其他导入之前执行 ========== # 使用 json_repair 替换 mem0 的 remove_code_blocks 函数 # 这必须在导入任何 mem0 模块之前执行