初始提交

This commit is contained in:
2026-11-04 19:58:07 +08:00
commit 53b7d22429
829 changed files with 469986 additions and 0 deletions

21
ai_deepseek/__init__.py Normal file
View File

@@ -0,0 +1,21 @@
# Part of the ai_deepseek module.
# -*- coding: utf-8 -*-
import logging
from . import deepseek_client
from . import models
from . import transport_patch
_logger = logging.getLogger(__name__)
def post_load_hook():
"""服务器启动、模块导入后立即接管传输层。
用 post_load 而非 post_init_hook:前者在**每次**服务器启动时都会执行,
从而保证重启后拦截持续生效(post_init 只在安装那一次跑)。
"""
try:
transport_patch.apply_patch()
except Exception: # noqa: BLE001
_logger.exception("ai_deepseek: 传输层接管失败,AI 将回退官方 IAP 服务")