diff --git a/kb_build/req_extra.txt b/kb_build/req_extra.txt new file mode 100644 index 0000000..5f307aa --- /dev/null +++ b/kb_build/req_extra.txt @@ -0,0 +1,20 @@ +httpx==0.28.1 +orjson==3.12.0 +sqlmodel==0.0.42 +cachetools==7.1.7 +trafilatura==2.2.0 +ddgs==9.16.0 +fake-useragent==2.2.0 +pybase64==1.5.0 +pillowmd==0.7.3 +lxml==6.1.2 +tiktoken==0.13.0 +makefun==1.16.0 +fastembed==0.8.0 +qdrant-client==1.15.1 +pydantic-ai==1.107.5 +numpy==2.5.2 +lightgbm==4.7.0 +scikit-learn==1.9.0 +model2vec==0.9.0 +rapidocr==3.9.2 diff --git a/kb_build/req_freeze.txt b/kb_build/req_freeze.txt new file mode 100644 index 0000000..9d757c6 --- /dev/null +++ b/kb_build/req_freeze.txt @@ -0,0 +1,102 @@ +aiofiles==25.1.0 +aiohttp==3.14.3 +aiosqlite==0.22.1 +annotated-types==0.7.0 +anyio==4.12.1 +APScheduler==3.11.3 +arclet-alconna==1.8.44 +arclet-alconna-tools==0.7.12 +argcomplete==3.7.2 +async-timeout==5.0.1 +openai==3.6.0 +beautifulsoup4==4.15.0 +bs4==0.0.2 +certifi==2025.8.3 +charset-normalizer==3.4.9 +click==8.5.0 +ecdsa==0.19.1 +exceptiongroup==1.3.1 +fastapi==0.115.6 +filetype==1.2.0 +greenlet==3.1.1 +h11==0.16.0 +httptools==0.8.0 +idna==3.19 +importlib_metadata==9.0.1 +iso8601==2.1.0 +jieba==0.42.1 +Jinja2==3.1.6 +loguru==0.7.2 +Markdown==3.10.3 +MarkupSafe==3.0.3 +msgpack==1.2.2 +multidict==6.7.1 +nepattern==0.7.8 +nonebot-adapter-onebot==2.4.6 +nonebot-plugin-alconna==0.62.1 +nonebot-plugin-apscheduler==0.2.0 +nonebot-plugin-htmlrender==0.8.1 +nonebot-plugin-localstore==0.7.4 +nonebot-plugin-send-anything-anywhere==0.7.1 +nonebot-plugin-uninfo==0.11.1 +nonebot-plugin-waiter==0.8.1 +nonebot2==2.5.0 +nonebot_plugin_learning_chat==0.4.0 +nonebot_plugin_withdraw==0.4.1 +packaging==25.0 +pillow==12.3.0 +pilmoji==2.0.5 +platformdirs==4.11.5 +playwright==1.59.0 +propcache==0.5.2 +pyasn1==0.6.4 +pydantic==2.13.5 +Pygments==2.20.0 +pygtrie==2.5.0 +pymdown-extensions==11.0.2 +python-dotenv==1.2.2 +python-jose==3.3.0 +python-markdown-math==0.9 +pytz==2023.3 +PyYAML==6.0.2 +requests==2.34.2 +rsa==4.9.1 +ruamel.yaml==0.17.40 +ruamel.yaml.clib==0.2.15 +six==1.17.0 +sniffio==1.3.1 +soupsieve==2.9.2 +starlette==0.41.3 +StrEnum==0.4.15 +tarina==0.7.5 +typing_extensions==4.16.0 +tzlocal==5.3.1 +urllib3==2.7.0 +uvicorn==0.52.4 +watchfiles==1.1.0 +websockets==16.1.1 +yarl==1.24.5 +zipp==4.1.0 +nonebot-plugin-wtfllm @ file:///root/wtfllm.zip +httpx==0.28.1 +orjson==3.12.0 +sqlmodel==0.0.42 +cachetools==7.1.7 +trafilatura==2.2.0 +ddgs==9.16.0 +fake-useragent==2.2.0 +pybase64==1.5.0 +pillowmd==0.7.3 +lxml==6.1.2 +tiktoken==0.13.0 +makefun==1.16.0 +fastembed==0.8.0 +qdrant-client==1.15.1 +pydantic-ai==1.107.5 +numpy==2.5.2 +lightgbm==4.7.0 +scikit-learn==1.9.0 +model2vec==0.9.0 +rapidocr==3.9.2 +pydantic-settings # wtfllm/nonebot 运行需要 +appdirs # pyppeteer 依赖 diff --git a/项目部署须知.md b/项目部署须知.md new file mode 100644 index 0000000..9c4739a --- /dev/null +++ b/项目部署须知.md @@ -0,0 +1,32 @@ +## 部署须知 + +1. 当前项目生产环境部署在 本地服务器 192.168.5.2上; +2. 可使用ssh技能,搭配本地密钥进行连接; +3. 服务器上的项目路径为:/bot/danding-bot + + + +## 常规升级、部署流程 + +1. 推送git代码; +2. 到指定服务器、指定程序目录,拉取git最新代码; + + + +## 注意点 + +- 所有服务器都使用1panel进行管理,包含网站、反代的搭建等; +- 需要使用git进行代码版本的管理、同步; +- 一切代码需要以git云端代码为准,若生产环境无法拉取,需要覆盖强制拉取; +- 所有的代码升级或部署后,需要确保服务正在运行最新版本的代码(重启当前服务,并确保服务可正常运行); +- 升级或部署前,若本地有未推送的代码,需要先推送到云端git; + + +## wtfllm(AI 帮助助手)部署要点(2026-08-30) + +1. 生产环境已切换到 `/bot/danding-bot/.venv`(Python 3.12),启动命令改为 `start_bot.sh`(内含 `FASTEMBED_CACHE_PATH` 与 `HF_HUB_OFFLINE=1` 环境变量); +2. 依赖按 `kb_build/req_freeze.txt` + `kb_build/req_extra.txt` 固定版本安装;`amis-python`、`nonebot_plugin_learning_chat`、`pyppeteer`、`nonebot-plugin-wtfllm` 需 `pip install --no-deps` 单独处理; +3. 模型缓存已预置在 `/bot/danding-bot/.fastembed_cache`(bge-small-zh + Qdrant/bm25),服务器无法直连 HuggingFace/GitHub,勿删除; +4. 知识库重灌:`cd /bot/danding-bot && FASTEMBED_CACHE_PATH=/bot/danding-bot/.fastembed_cache HF_HUB_OFFLINE=1 .venv/bin/python kb_build/import_kb.py --agent-id 1411350196`; +5. 若启动报 Qdrant 启动超时,先 `kill -9` 残留的 qdrant.exe/qdrant 进程(数据目录被锁)再重启; +6. wtfllm 仅在群 621016172 响应(见 `danding_bot/plugins/wtfllm_gate.py`)。