{"id":91,"date":"2026-12-06T10:55:07","date_gmt":"2026-12-06T02:55:07","guid":{"rendered":"https:\/\/wp.xybcm.cn\/?p=91"},"modified":"2026-12-06T11:39:25","modified_gmt":"2026-12-06T03:39:25","slug":"maibot-docker-qq-official","status":"publish","type":"post","link":"https:\/\/wp.xybcm.cn\/?p=91","title":{"rendered":"\u7528 Docker \u90e8\u7f72 MaiBot\uff5c\u6a21\u578b\u8c03\u901a\u4e0e QQ \u5b98\u65b9\u673a\u5668\u4eba\u63a5\u5165"},"content":{"rendered":"<p>\u7528 Docker Compose \u90e8\u7f72 MaiBot\uff0c\u5148\u8ba9\u6a21\u578b\u5728 WebUI \u91cc\u8dd1\u901a\u4e00\u8f6e\u56de\u590d\uff0c\u518d\u63a5 QQ \u5b98\u65b9\u673a\u5668\u4eba\u3002\u6d41\u7a0b\u672c\u8eab\u4e0d\u957f\uff0c\u8e29\u70b9\u96c6\u4e2d\u5728\u4e09\u5904\uff1a<strong>\u6302\u8f7d\u76ee\u5f55<\/strong>\u3001<strong>\u914d\u7f6e\u7ed3\u6784<\/strong>\u3001<strong>\u5e73\u53f0\u4fa7\u7684 OpenID \u5f52\u4e00\u5316<\/strong>\u3002<\/p>\n<p>\u672c\u6587\u5bf9\u5e94\u955c\u50cf <code>sengokucola\/maibot:1.4.8<\/code>\uff0c\u9879\u76ee\u4e0e\u6587\u6863\u89c1 <a href=\"https:\/\/github.com\/MaiM-with-u\/MaiBot\" rel=\"nofollow\">MaiBot \u5b98\u65b9\u4ed3\u5e93<\/a>\u3002\u4ee5\u4e0b\u6240\u6709\u8def\u5f84\u3001\u7aef\u53e3\u3001\u914d\u7f6e\u9879\u90fd\u4ee5\u8fd9\u4e2a\u7248\u672c\u4e3a\u51c6\uff1b\u8de8\u5927\u7248\u672c\u65f6\u52a1\u5fc5\u5148\u770b\u5b98\u65b9\u8fc1\u79fb\u8bf4\u660e\u3002<\/p>\n<h2>\u4e00\u3001\u76ee\u5f55\u4e0e\u914d\u7f6e\u7ed3\u6784<\/h2>\n<p>\u5148\u8ba4\u6e05\u8fd9\u4e00\u70b9\uff0c\u5426\u5219\u300c\u6539\u4e86\u914d\u7f6e\u6ca1\u53cd\u5e94\u300d\u4f1a\u53cd\u590d\u53d1\u751f\u3002\u4e0b\u9762\u7528 <code>&lt;\u90e8\u7f72\u6839&gt;<\/code> \u6307\u4ee3\u4f60\u81ea\u5df1\u7684\u90e8\u7f72\u76ee\u5f55\uff0c1.4.8 \u7684\u5e03\u5c40\u662f\uff1a<\/p>\n<ul>\n<li>\u914d\u7f6e\u4e0e\u6570\u636e\uff1a<code>&lt;\u90e8\u7f72\u6839&gt;\/maibot\/data\/<\/code>\uff1b<\/li>\n<li>compose \u6587\u4ef6\u5728\u4e0a\u4e00\u5c42\uff1a<code>&lt;\u90e8\u7f72\u6839&gt;\/docker-compose.yml<\/code>\uff0c<strong>\u4e0d\u5728<\/strong> <code>maibot\/<\/code> \u91cc\u9762\uff1b<\/li>\n<li>\u8865\u4e01\u653e\u5728 <code>&lt;\u90e8\u7f72\u6839&gt;\/maibot\/patches\/<\/code>\u3002<\/li>\n<\/ul>\n<p>\u914d\u7f6e\u6587\u4ef6\u6309\u4f5c\u7528\u57df\u5206\u6210\u4e09\u5c42\uff0c\u5bb9\u6613\u641e\u6df7\uff1a<\/p>\n<ul>\n<li><code>data\/MaiMBot-host\/config.toml<\/code> \u2014\u2014 host \u5168\u5c40\uff1b<\/li>\n<li><code>data\/MaiMBot-bots\/&lt;bot_id&gt;\/config\/<\/code> \u2014\u2014 \u6bcf\u4e2a Bot \u4e00\u4efd\uff1b<\/li>\n<li><code>docker-config\/mmc\/<\/code> \u4e0b\u7684 <code>model_config.toml<\/code> \u4e0e <code>bot_config.toml<\/code> \u2014\u2014 \u6a21\u578b\u4e0e\u6838\u5fc3\u914d\u7f6e\uff0c\u5bb9\u5668\u6302\u5230 <code>\/MaiMBot\/config<\/code>\uff0c<strong>\u5168\u9879\u76ee\u53ea\u6709\u8fd9\u4e00\u4efd<\/strong>\u3002<\/li>\n<\/ul>\n<p>\u7aef\u53e3\u6620\u5c04\uff08\u5bbf\u4e3b\u4fa7\uff09\uff1a<code>maibot-core<\/code> <strong>8001 \u2192 18001<\/strong>\u3001<code>maibot-embedding<\/code> <strong>8080 \u2192 18080<\/strong>\u3001<code>maibot-sqlite-web<\/code> <strong>8080 \u2192 18120<\/strong>\u3002\u5bb9\u5668\u5185 <code>[http] port<\/code> \u586b\u7684\u662f 8001\uff0c\u4e0d\u662f\u5bbf\u4e3b\u7684 18001\u3002<\/p>\n<h2>\u4e8c\u3001\u62c9\u955c\u50cf\uff1a\u76f4\u8fde\u4e0d\u901a\uff0c\u7528\u54ea\u4e2a\u6e90<\/h2>\n<p>\u56fd\u5185\u7f51\u7edc\u4e0b Docker Hub \u76f4\u8fde\u57fa\u672c\u62c9\u4e0d\u52a8\u3002\u7b2c\u4e09\u65b9\u955c\u50cf\u6e90\u91cc\u6709\u4e00\u7c7b\u8868\u73b0\u7279\u522b\u6709\u6b3a\u9a97\u6027\uff1a<strong>\u663e\u793a <code>Download complete<\/code> \u4f46 overlay2 \u96f6\u589e\u957f<\/strong>\uff0c\u4e5f\u5c31\u662f\u5047\u6b7b\u3002\u6539\u7528 <code>docker.m.daocloud.io<\/code> \u8fd9\u7c7b\u52a0\u901f\u5668\u53ef\u4ee5\u6b63\u5e38\u62c9\u5b8c\uff081.5 GB \u955c\u50cf\u7ea6 3 \u5206\u949f\uff09\u3002<\/p>\n<p>\u4e5f\u53ef\u4ee5\u5148\u62c9\u52a0\u901f\u5668\u5730\u5740\u518d <code>docker tag<\/code> \u6539\u56de\u5b98\u65b9\u540d\u3002\u26a0\ufe0f <strong>tag \u4e00\u5b9a\u8981\u9489\u6b7b\u7248\u672c\u53f7\uff0c\u522b\u7528 <code>latest<\/code><\/strong>\uff1a<code>latest<\/code> \u4e0e\u67d0\u4e2a\u5177\u4f53\u7248\u672c\u53ef\u80fd\u6307\u5411\u540c\u4e00\u4e2a digest\uff0c\u6b64\u65f6\u4f60\u4ee5\u4e3a\u5728\u8dd1\u65b0\u7248\u672c\uff0c\u5b9e\u9645\u5e76\u6ca1\u6709\u3002\u7528 <code>docker inspect --format='{{.RepoDigests}}'<\/code> \u6838\u5bf9\u3002<\/p>\n<h2>\u4e09\u3001\u542f\u52a8\uff1a\u4e24\u4e2a\u5fc5\u6302\u7684\u5751<\/h2>\n<h3>\u5751 1\uff1a<code>\/MaiMBot\/host<\/code> \u4e0d\u6302\u8f7d\u76f4\u63a5 exit 1<\/h3>\n<p>1.4.x \u7684 entrypoint \u4f1a\u7528 <code>awk<\/code> \u89e3\u6790 <code>\/proc\/self\/mountinfo<\/code> \u68c0\u67e5 <code>\/MaiMBot\/host<\/code> \u662f\u5426\u662f\u88ab\u6302\u8f7d\u7684\u6301\u4e45\u5316\u76ee\u5f55\uff0c<strong>\u4e0d\u6302\u5c31\u76f4\u63a5\u9000\u51fa\u7801 1<\/strong>\u3002\u8fd9\u8ddf\u7528\u4e0d\u7528 <code>bots\/<\/code> \u65e0\u5173\uff0c<strong>\u539f\u5730\u5347\u7ea7\u4e5f\u5fc5\u987b\u52a0<\/strong>\u3002\u4e09\u4e2a\u6302\u8f7d\u70b9\uff1a<\/p>\n<pre><code>.\/data\/MaiMBot-host:\/MaiMBot\/host\n.\/data\/MaiMBot-bots:\/MaiMBot\/bots\n.\/data\/MaiMBot-plugin-data:\/MaiMBot\/data\/plugins<\/code><\/pre>\n<p>\u26a0\ufe0f \u5982\u679c <code>MaiMBot-plugin-data<\/code> \u76ee\u5f55\u4e0d\u5b58\u5728\uff0c\u4f1a\u5148\u62a5 <code>Bind mount failed ... does not exist<\/code>\uff0ccore \u76f4\u63a5\u8d77\u4e0d\u6765\u3002\u5efa\u76ee\u5f55\u5373\u53ef\u3002<\/p>\n<h3>\u5751 2\uff1a<code>[http]<\/code> \u6bb5\u7f3a\u5931\u4f1a\u5d29\u5728 <code>OSError: [Errno 99]<\/code><\/h3>\n<p>\u6e90\u7801 <code>src\/host\/config.py::config_from_bot()<\/code> \u627e\u4e0d\u5230 <code>[http]<\/code> \u6bb5\u65f6\uff0c\u4f1a\u56de\u843d\u5230\u9ed8\u8ba4\u503c <code>DEFAULT_HOSTS=[\"127.0.0.1\",\"::1\"]<\/code>\u3002\u800c\u5bb9\u5668\u91cc<strong>\u6ca1\u6709 IPv6<\/strong>\uff08<code>\/proc\/net\/if_inet6<\/code> \u884c\u6570\u4e3a 0\uff09\uff0c\u7ed1 <code>::1<\/code> \u5fc5\u7136\u5931\u8d25\uff0c\u62a5 <code>OSError: [Errno 99]<\/code>\u3002<\/p>\n<pre><code>[http]\nhost = \"0.0.0.0\"\nport = 8001     # \u5bb9\u5668\u5185\u7aef\u53e3\uff0c\u4e0d\u662f\u5bbf\u4e3b 18001<\/code><\/pre>\n<h3>\u5751 3\uff1a<code>WEBUI_HOST<\/code> \u4e0e\u914d\u7f6e\u6587\u4ef6\u8bed\u4e49\u53e0\u52a0<\/h3>\n<p>\u5b98\u65b9 compose \u6ce8\u5165 <code>WEBUI_HOST=0.0.0.0<\/code> \u65f6\uff0c\u8fd9\u4e2a\u503c\u4f1a<strong>\u8ffd\u52a0<\/strong>\u5230 <code>bot_config.toml<\/code> \u7684 <code>webui.host=[\"127.0.0.1\",\"::1\"]<\/code> \u4e4b\u4e0a\uff0c\u4e8e\u662f\u62a5\u300c\u7aef\u53e3 8001 \u5df2\u88ab\u5360\u7528 (host=::1)\u300d\uff0cWebUI \u8d77\u4e0d\u6765\u3002\u4e09\u6761\u4fee\u6cd5\u9009\u4e00\uff1a\u628a\u914d\u7f6e\u6587\u4ef6\u91cc <code>webui.host<\/code> \u6539\u6210 <code>[\"0.0.0.0\"]<\/code>\uff1b\u6216\u4ece compose \u5220\u6389 <code>WEBUI_HOST<\/code>\uff1b\u6216 <code>compose up -d --force-recreate core<\/code>\u3002\u6559\u8bad\u662f<strong>\u8fd9\u4e24\u5904\u662f\u53e0\u52a0\u5173\u7cfb\uff0c\u522b\u4e24\u4e2a\u90fd\u8bbe<\/strong>\u3002<\/p>\n<h3>\u5751 4\uff1aBOM \u9677\u9631\uff0c\u53ea\u5728\u5199\u7684\u65f6\u5019<\/h3>\n<p>\u8fd9\u4e2a\u5751\u5f88\u9690\u853d\uff1a<code>bot_config.toml<\/code> \u539f\u672c\u65e0 BOM\u3002\u5982\u679c\u7528 Python \u4ee5 <code>encoding=\"utf-8-sig\"<\/code> \u8bfb\uff08\u81ea\u52a8\u53bb BOM\uff09\uff0c\u7136\u540e\u53c8<strong>\u7528\u540c\u6837\u7684 <code>utf-8-sig<\/code> \u5199\u56de\u53bb<\/strong>\uff0c\u5c31\u4f1a\u5199\u8fdb BOM\uff0c\u4e8e\u662f <code>tomllib<\/code> \u62a5<\/p>\n<pre><code>Invalid statement (at line 1, column 1)<\/code><\/pre>\n<p>\u542f\u52a8\u5931\u8d25\u3002<strong>\u8bfb\u53ef\u4ee5\u7528 <code>utf-8-sig<\/code>\uff0c\u5199\u5fc5\u987b\u7528 <code>utf-8<\/code>\u3002<\/strong><\/p>\n<h3>\u542f\u52a8\u4e0e\u91cd\u8f7d<\/h3>\n<pre><code>docker compose config -q\ndocker compose up -d core\ndocker compose ps core\ndocker compose logs --tail=80 core<\/code><\/pre>\n<p>\u26a0\ufe0f <code>docker compose restart &lt;svc&gt;<\/code> <strong>\u4e0d\u4f1a\u5e94\u7528\u65b0\u589e\u7684\u6302\u8f7d<\/strong>\u2014\u2014\u5b83\u4e0d\u91cd\u5efa\u5bb9\u5668\uff0c<code>docker inspect<\/code> \u91cc\u770b\u4e0d\u5230\u65b0\u6761\u76ee\uff0c\u5bb9\u5668\u5185\u6587\u4ef6 md5 \u8fd8\u662f\u65e7\u7684\u3002\u75c7\u72b6\u6781\u5177\u8ff7\u60d1\u6027\uff1acompose config \u91cc\u6709\u3001\u6587\u4ef6\u4e5f\u62f7\u5bf9\u4e86\u3001restart \u4e5f\u300c\u6210\u529f\u300d\uff0c\u5bb9\u5668\u5185\u8fd8\u662f\u65e7\u6587\u4ef6\u3002<strong>\u5fc5\u987b\u7528 <code>up -d<\/code><\/strong>\u3002<\/p>\n<p>\u26a0\ufe0f \u975e\u4ea4\u4e92 SSH \u4e0b <code>docker<\/code> \u4e0d\u5728 PATH\uff0c\u8981\u5199\u5168\u8def\u5f84 <code>sudo \/var\/packages\/ContainerManager\/target\/usr\/bin\/docker<\/code>\u3002<\/p>\n<p>1.4.8 \u652f\u6301\u914d\u7f6e\u70ed\u91cd\u8f7d\uff1a\u6539\u5b8c <code>bot_config.toml<\/code> \u540e\u65e5\u5fd7\u4f1a\u51fa\u73b0\u300c\u68c0\u6d4b\u5230\u914d\u7f6e\u6587\u4ef6\u53d8\u66f4\uff0c\u89e6\u53d1\u70ed\u91cd\u8f7d\u300d\uff0c\u4e0d\u5fc5\u91cd\u542f\u5bb9\u5668\u3002\u4f46 <strong>compose \u5c42\u9762\u7684\u6539\u52a8\uff08\u7aef\u53e3\u3001\u6302\u8f7d\u3001\u73af\u5883\u53d8\u91cf\uff09\u4e0d\u8d70\u70ed\u91cd\u8f7d<\/strong>\uff0c\u5fc5\u987b <code>up -d<\/code>\u3002<\/p>\n<h2>\u56db\u3001\u8dd1\u901a\u4e00\u8f6e\u56de\u590d<\/h2>\n<p>\u8bbf\u95ee <code>http:\/\/&lt;\u5bbf\u4e3b&gt;:18001<\/code>\u3002\u26a0\ufe0f \u8ba4\u8bc1\u662f Cookie <code>maibot_session=&lt;token&gt;<\/code>\uff0c<strong>\u4e0d\u662f <code>Authorization: Bearer<\/code><\/strong>\u2014\u2014\u7528\u9519 header \u4f1a\u4e00\u76f4 401\uff0c\u6240\u4ee5 curl \u6d4b\u8bd5\u8981\u5e26 <code>-b<\/code>\u3002Token \u5b58\u5728 <code>data\/MaiMBot\/webui.json<\/code>\uff08<code>token_source=configured<\/code>\uff09\u3002<\/p>\n<p>\u6a21\u578b\u69fd\u4f4d\u7684 <code>max_tokens<\/code> \u6709\u4e00\u6761\u786c\u89c4\u5219\uff1a<strong>\u69fd\u4f4d\u4f1a\u5bf9 <code>model_list<\/code> \u987a\u5e8f\u964d\u7ea7\uff0c\u6240\u4ee5 <code>max_tokens<\/code> \u5fc5\u987b\u53d6\u8be5\u5217\u8868\u6240\u6709\u6a21\u578b\u4e0a\u9650\u7684\u6700\u5c0f\u503c<\/strong>\uff0c\u5426\u5219\u964d\u7ea7\u90a3\u4e00\u523b\u5c31 400\u3002\u5b9e\u6d4b\u914d\u7f6e\uff1a<code>replyer<\/code>\/<code>planner<\/code>\/<code>utils<\/code>\/<code>voice<\/code>\/<code>tts<\/code>\/<code>learner<\/code>\/<code>fast_model<\/code> = <strong>65536<\/strong>\uff1b<code>memory<\/code>\/<code>vlm<\/code> = <strong>128000<\/strong>\uff1b<code>embedding<\/code>\/<code>image_embedding<\/code> \u4fdd\u6301 <strong>4096<\/strong>\u3002<\/p>\n<p>\u5404\u5bb6\u771f\u5b9e\u786c\u4e0a\u9650\uff08\u8d85\u4e86\u76f4\u63a5 400\uff0c\u522b\u4fe1\u7eb8\u9762\uff09\uff1a<code>deepseek-v4.1-flash<\/code> \u58f0\u660e 128000\uff08\u5b9e\u6d4b 500000 \u4e5f\u63a5\u53d7\uff09\uff1b<code>glm-5.3-flash<\/code> 131072\uff08150000 \u63a5\u53d7\uff09\uff1b<code>mimo-v2.6-flash<\/code> 131072\uff08200000 \u62a5 <code>max_tokens is too large<\/code>\uff09\uff1b<code>sensenova-6.8-flash-lite<\/code> 65536\uff08\u786c\u6821\u9a8c <code>[1, 65536]<\/code>\uff09\u3002<\/p>\n<p>\u62a5\u9519\u5bf9\u7167\uff1a401 \u6838\u5bc6\u94a5\u3001404 \u6838\u534f\u8bae\u8def\u5f84\u4e0e\u6a21\u578b id\u3002<strong>\u80fd\u5217\u51fa\u6a21\u578b\u4e0d\u7b49\u4e8e\u80fd\u7528\uff0c\u5fc5\u987b\u53d1\u4e00\u6b21\u771f\u5b9e\u8bf7\u6c42\u3002<\/strong><\/p>\n<h2>\u4e94\u3001\u63a5 QQ \u5b98\u65b9\u673a\u5668\u4eba<\/h2>\n<p>1.4.0 \u8d77\u5185\u7f6e <code>qq_official_adapter<\/code>\uff08v0.5.0\uff09\uff0c\u914d\u7f6e\u5728 <code>docker-config\/mmc\/builtin_plugins\/qq_official_adapter\/config.toml<\/code>\uff0c\u586b app_id \/ secret \u5373\u53ef\uff0c\u5b83\u4e3b\u52a8\u8fde\u5b98\u65b9 WebSocket\u3002<\/p>\n<p>\u26a0\ufe0f \u534f\u8bae\u7aef\u90a3\u5957\u5df2\u7ecf\u4e0d\u80fd\u7528\u4e86\uff1a<code>maibot-team.napcat-adapter<\/code> v1.4.1 \u7ea6\u675f host <code>1.2.0\u20131.3.99<\/code>\uff08<strong>\u4e0a\u754c 1.3.99<\/strong>\uff09\uff0c\u4e0d\u517c\u5bb9 1.4.8\uff0cNapCat \u5bb9\u5668\u5df2\u5f7b\u5e95\u9000\u573a\u3002<\/p>\n<h3>\u5751 5\uff1a<code>code=100016 invalid appid or secret<\/code><\/h3>\n<p>\u8fd9\u4e2a\u9519\u8bef<strong>\u4e0d\u533a\u5206\u662f ID \u9519\u8fd8\u662f secret \u9519<\/strong>\u3002\u6392\u67e5\u6cd5\uff1a<code>appId=1<\/code> \u8fd4\u56de <code>10004 \u673a\u5668\u4eba\u4e0d\u5b58\u5728<\/code>\uff08\u8bf4\u660e ID \u683c\u5f0f\u6821\u9a8c\u80fd\u8fc7\uff09\uff1b<code>appId=\"\"<\/code> \u8fd4\u56de <code>100007 appid invalid<\/code>\u3002\u672c\u6b21\u771f\u56e0\u662f <strong>secret \u53ea\u6284\u4e86 16 \u4f4d<\/strong>\uff08\u4ece\u622a\u56fe\u6284\u4e0b\u6765\u88ab\u622a\u65ad\uff09\uff0c\u6b63\u786e\u503c\u662f <strong>32 \u4f4d<\/strong>\u3002<\/p>\n<h3>\u5751 6\uff1a\u7fa4\u91cc @ \u673a\u5668\u4eba\uff0c\u80fd\u6536\u5230\u4f46\u4e0d\u56de\u590d<\/h3>\n<p>\u8fd9\u662f\u672c\u6587\u6700\u503c\u5f97\u6284\u8d70\u7684\u4e00\u6761\u3002\u73b0\u8c61\uff1a\u6d88\u606f\u80fd\u6536\u5230\u5e76\u5165\u5e93\uff0c\u4f46 <code>is_at=0<\/code>\uff0c\u6c38\u8fdc\u4e0d\u56de\u590d\u3002<\/p>\n<p>\u6839\u56e0\u94fe\uff1aQQ \u628a<strong>\u5168\u91cf\u7fa4\u6d88\u606f<\/strong>\u90fd\u63a8\u5230 <code>GROUP_MESSAGE_CREATE<\/code>\uff08<strong>\u4e0d\u662f<\/strong> <code>GROUP_AT_MESSAGE_CREATE<\/code>\uff09\uff0c\u6240\u4ee5\u9002\u914d\u5668\u5fc5\u987b\u9010\u9879\u6bd4\u5bf9 <code>mentions<\/code>\u3002\u800c <code>mentions<\/code> \u91cc\u7ed9\u7684\u662f<strong>\u7fa4\u6210\u5458 OpenID<\/strong>\uff08\u5982 <code>CE1662B9\u2026<\/code>\uff09\uff0c\u9002\u914d\u5668\u5374\u62ff<strong>\u5168\u5c40 OpenID<\/strong>\uff08<code>5362877\u2026<\/code>\uff09\u53bb\u6bd4 \u21d2 \u6c38\u4e0d\u5339\u914d\u3002<\/p>\n<p>\u5173\u952e\u70b9\uff1a<strong>\u5e73\u53f0\u5176\u5b9e\u5df2\u7ecf\u6807\u6ce8\u4e86 <code>mentions[i].is_you = true<\/code>\uff0c\u5b98\u65b9\u9002\u914d\u5668\u4ee3\u7801\u6ca1\u7528\u5b83\u3002<\/strong>\u8865\u4e01\u6302\u5230 <code>\/MaiMBot\/src\/plugins\/built_in\/qq_official_adapter\/codec.py<\/code>\uff0c\u4f18\u5148\u8ba4 <code>is_you is True<\/code>\u3002\u9a8c\u8bc1\u7528\u771f\u503c\u8868\uff1a\u5168\u91cf\u7fa4\u6d88\u606f + <code>is_you=True<\/code> \u2192 True\uff1b<code>is_you=False<\/code> \u2192 False\uff1b<code>GROUP_AT_MESSAGE_CREATE<\/code> \u2192 True\u3002<\/p>\n<h3>\u5751 7\uff1a\u673a\u5668\u4eba\u4e0d\u53d1\u8868\u60c5\u5305<\/h3>\n<p><code>patches\/reply.py<\/code> \u67d0\u884c\u9ed8\u8ba4\u7981\u7528\u4e86 <code>attach_emoji<\/code>\uff08\u6ce8\u91ca\u5199\u660e\u662f\u9632\u9519\u914d\uff09\uff0c\u8fd9\u5c31\u662f\u300c\u4e0d\u53d1\u8868\u60c5\u5305\u300d\u7684\u771f\u56e0\u3002\u6539\u5b8c<strong>\u5fc5\u987b restart<\/strong>\u2014\u2014\u5bb9\u5668\u6302\u7684\u662f\u65e7 inode\uff0c\u4e0d\u91cd\u542f\u6539\u4e0d\u751f\u6548\u3002<\/p>\n<h3>\u5751 8\uff1acustom prompt \u6587\u4ef6\u540d\u6539\u4e86<\/h3>\n<p>1.4.8 \u7684\u7fa4\u804a\u56de\u590d prompt \u6587\u4ef6\u540d\u662f <strong><code>retro_replyer.prompt<\/code><\/strong>\u3002\u8986\u76d6\u6587\u4ef6\u5fc5\u987b\u653e\u5728 <code>data\/MaiMBot\/custom_prompts\/zh-CN\/main\/reply\/group\/retro_replyer.prompt<\/code>\uff1b\u800c\u4e14\u5b9e\u6d4b\u653e\u5728\u5206\u7c7b\u5b50\u76ee\u5f55\u91cc\u540c\u6837\u8bfb\u4e0d\u5230\u2014\u2014<code>resolve_prompt_path<\/code> \u53ea\u67e5\u8bed\u8a00\u6839\u76ee\u5f55 <code>zh-CN\/retro_replyer.prompt<\/code>\u3002<\/p>\n<h2>\u516d\u3001\u8eab\u4efd\u5f52\u4e00\u5316\uff1a\u53ea\u6709 OpenID \u7684\u4e16\u754c<\/h2>\n<p>\u5982\u679c\u786e\u5b9a\u4ee5\u540e\u4e00\u76f4\u7528\u5b98\u65b9\u5ba2\u6237\u7aef\uff0c\u90a3\u5bf9\u624b\u91cc\u5c31\u53ea\u5269 OpenID\uff0c\u6ca1\u6709 QQ \u53f7\u3002\u8fd9\u65f6\u8981\u628a\u6620\u5c04\u5173\u6389\u3001\u628a\u5386\u53f2\u6570\u636e\u6e05\u6d17\u4e00\u904d\u3002<\/p>\n<p><code>session_id<\/code> \u7684\u6784\u9020\uff08<code>src\/common\/utils\/utils_session.py<\/code>\uff09\uff1a<\/p>\n<pre><code>components = [platform, f\"account:{account_id}\", user_id|group_id, \"private\"]  # \u79c1\u804a\u591a\u4e00\u4e2a private \u5c3e\nsession_id = md5(\"_\".join(components))<\/code><\/pre>\n<p>\u21d2 <strong>\u6362 ID \u5fc5\u7136\u6362 session<\/strong>\uff0c\u8fd9\u662f\u786c\u6027\u7684\uff0c\u6ca1\u6cd5\u517c\u5bb9\u3002\u6700\u7ec8\u914d\u7f6e\uff1a<code>unified_account_id<\/code> \u56fa\u5b9a\u3001<code>enable_mapping = false<\/code>\u3001<code>silent_user_sync = false<\/code>\uff0c<code>id_map.json<\/code> \u6e05\u7a7a\u6210 <code>{\"group\":{},\"user\":{}}<\/code>\u3002<\/p>\n<p>\u843d\u5e93\u91cf\uff08\u8bf4\u660e\u6e05\u6d17\u786e\u5b9e\u8dd1\u8fc7\uff09\uff1a\u79c1\u804a <code>user_id<\/code> \u66ff\u6362 293 \u6761\u3001\u7fa4\u804a <code>group_id<\/code> \u66ff\u6362 3652 \u6761\uff0c\u8865\u6f0f\u673a\u5668\u4eba\u81ea\u5df1\u53d1\u7684 337 \u6761\u79c1\u804a\u3002<strong>\u7fa4\u804a\u91cc\u4ecd\u6709 708 \u6761 <code>user_id<\/code> \u662f QQ \u53f7<\/strong>\uff08\u5176\u4e2d\u672c\u4eba\u5360 705 \u6761\uff09\uff0c\u53ea\u80fd\u968f\u65b0\u6d88\u606f\u81ea\u7136\u66ff\u6362\u3002<\/p>\n<h2>\u4e03\u3001\u8fd0\u7ef4\u4e0e\u89c2\u6d4b<\/h2>\n<h3>\u5b58\u6d3b\u4e0e\u7edf\u8ba1<\/h3>\n<pre><code>GET \/api\/webui\/health                    # \u514d\u9274\u6743\uff0c{\"status\":\"healthy\"}\nGET \/api\/webui\/statistics\/summary?hours=24<\/code><\/pre>\n<p>\u7edf\u8ba1\u6709\u56db\u4ef6\u5957 <code>\/api\/webui\/statistics\/{summary,dashboard,detailed,models}<\/code>\u3002<code>summary?hours=24<\/code> \u7ea6 481 B \/ 14 ms\uff0c\u53ef\u4ee5\u8f6e\u8be2\uff1b<strong><code>detailed<\/code> \u6709 182 KB\uff0c\u522b\u8f6e\u8be2<\/strong>\u3002\u26a0\ufe0f \u7cfb\u7edf<strong>\u6ca1\u6709\u4efb\u4f55\u300c\u9519\u8bef\u6570\/\u5931\u8d25\u7387\u300d\u7aef\u70b9<\/strong>\u3002\u53e6\u5916\u300c\u56de\u590d\u6761\u6570\u300d\u7684\u6b63\u786e\u53e3\u5f84\u662f <code>tool_records<\/code> \u8868\u91cc <code>tool_name='reply'<\/code> \u7684\u6761\u6570\uff0c\u4e0d\u662f\u65e5\u5fd7\u884c\u6570\u3002\u8d39\u7528\u5355\u4f4d\u662f<strong>\u4eba\u6c11\u5e01\u5143<\/strong>\u3002<\/p>\n<p>\u91cf\u7ea7\u53c2\u8003\uff08\u4e00\u4e2a\u5728\u4e2d\u7b49\u6d3b\u8dc3\u7fa4\u91cc\u8dd1\u7740\u7684\u5b9e\u4f8b\uff09\uff1a<strong>\u65e5\u5747\u6d88\u606f\u7ea6 300 \u6761\u3001\u56de\u590d\u7ea6 20 \u6761\u3001\u8bf7\u6c42\u7ea6 400 \u6b21\u3001token \u7ea6 130 \u4e07\u3001\u8d39\u7528\u7ea6 \u00a51<\/strong>\u3002\u4e5f\u5c31\u662f\u8bf4\u4e00\u6b21\u56de\u590d\u5e73\u5747\u8981\u6d88\u8017\u5341\u51e0\u6b21\u8bf7\u6c42\u3001\u6570\u4e07 token\u2014\u2014\u8fd9\u6b63\u662f\u4e0b\u4e00\u8282\u8981\u62c6\u89e3\u7684\u5730\u65b9\u3002\u6240\u6709\u7edf\u8ba1\u63a5\u53e3\u54cd\u5e94\u90fd\u5728 40 ms \u5185\u3002<\/p>\n<h3>\u94b1\u82b1\u5728\u54ea\uff1aplanner \u5403\u6389\u4e86 90%<\/h3>\n<p>\u8fd9\u662f\u8c03\u4f18\u7684\u91cd\u70b9\uff0c\u4e0d\u662f\u7384\u5b66\u3002900 \u6b21\u8c03\u7528\u7684\u6784\u6210\uff08478 planner \/ 201 replyer\uff09\uff1a<\/p>\n<ul>\n<li><strong>planner \u5360 90.4% \u7684\u8f93\u5165 token<\/strong>\uff084.76 M tok\uff09\uff1b<\/li>\n<li>\u6bcf\u6b21\u56de\u590d = <strong>4.5 \u6b21 LLM \u8c03\u7528<\/strong> \/ \u8f93\u5165 26177 tok \/ \u8f93\u51fa 1466 tok\uff1b<\/li>\n<li>planner \u5355\u6b21 token \u4e2d\u4f4d\u6570 9855\uff0c\u5176\u4e2d\u5386\u53f2\u6d88\u606f 40882 \u5b57\u7b26 = <strong>86%<\/strong>\uff1b<\/li>\n<li>478 \u6b21 planner \u51b3\u7b56\u91cc\u53ea\u6709 <strong>45.2% \u771f\u7684\u56de\u590d<\/strong>\uff0c<code>wait<\/code> \u7eaf\u76d1\u542c 185 \u6b21\uff0838.7%\uff09\u3002<\/li>\n<\/ul>\n<p>\u21d2 \u60f3\u8ba9\u6210\u672c\u964d\u4e0b\u6765\uff0c\u52a8 planner \u7684\u8f93\u5165\u957f\u5ea6\u6bd4\u6362\u66f4\u4fbf\u5b9c\u7684\u6a21\u578b\u66f4\u6709\u6548\u3002<\/p>\n<h3>\u7f13\u5b58\u547d\u4e2d\u662f\u6210\u672c\u7684\u51b3\u5b9a\u56e0\u7d20\uff0c\u4f46\u8fd9\u91cc\u5403\u4e0d\u5230<\/h3>\n<p>\u5b9e\u6d4b\u7f13\u5b58\u8f93\u5165\u53ea\u5360 <strong>0.9%<\/strong>\u3001\u8f93\u51fa\u5360 63.3%\uff0c\u7b49\u4e8e\u6bcf\u8f6e\u90fd\u662f\u5168\u65b0 context\u3002\u771f\u56e0\u4e0d\u662f\u914d\u7f6e\u9519\uff0c\u800c\u662f<strong>\u8bf7\u6c42\u592a\u77ed<\/strong>\u2014\u2014\u666e\u904d\u53ea\u6709 200\u2013300 token\uff0c\u4f4e\u4e8e\u7f13\u5b58\u95e8\u69db\uff08<code>pt\u22481000<\/code>\uff09\u3002<\/p>\n<h3>\u8d85\u65f6\u600e\u4e48\u5b9a\uff1a\u770b\u5ef6\u8fdf\u5206\u5e03\uff0c\u4e0d\u8981\u62cd\u8111\u888b<\/h3>\n<p>847 \u6b21\u91c7\u6837\u7684 p50\/p90\/p95\/p99\/max\uff1aplanner <strong>4.7 \/ 9.5 \/ 11.7 \/ 100.1 \/ 117.7 s<\/strong>\uff0creplyer <strong>3.8 \/ 8.5 \/ 12.5 \/ 29.1 \/ 60.0 s<\/strong>\u3002\u5173\u952e\u53d1\u73b0\uff1a<strong>30 s \u5230 89 s \u4e4b\u95f4\u4e00\u6761\u6210\u529f\u90fd\u6ca1\u6709<\/strong>\uff08\u5929\u7136\u65ad\u5c42\uff09\u21d2 provider \u8d85\u65f6\u76f4\u63a5\u4ece 120 s \u6539\u5230 30 s\uff0c\u4e0d\u4f1a\u8bef\u6740\u4efb\u4f55\u6b63\u5e38\u8bf7\u6c42\u3002<\/p>\n<h3>\u4e0a\u4e0b\u6587\u7a97\u53e3\u6ca1\u6709\u60f3\u8c61\u4e2d\u5927<\/h3>\n<p><code>CONTEXT_RESTORE_FILL_RATIO = 0.5<\/code>\u3001<code>max_private_context_size = 60<\/code> \u21d2 \u542f\u52a8\u65f6\u53ea<strong>\u6062\u590d 30 \u6761<\/strong>\u5386\u53f2\uff0c\u4e0d\u662f\u628a\u51e0\u767e\u6761\u5168\u585e\u8fdb\u53bb\u3002\u6240\u4ee5\u300c\u5386\u53f2\u8d8a\u591a\u8d8a\u6162\/\u8d8a\u8d35\u300d\u8fd9\u4e2a\u62c5\u5fc3\uff0c\u5728\u542f\u52a8\u6062\u590d\u8fd9\u4e00\u5c42\u662f\u4e0d\u6210\u7acb\u7684\u3002<\/p>\n<h2>\u516b\u3001\u6570\u636e\u5e93\u8fc1\u79fb\u4e0e\u7ef4\u62a4<\/h2>\n<p>\u9996\u6b21\u542f\u52a8\u4f1a\u81ea\u52a8\u6267\u884c\u6570\u636e\u5e93\u8fc1\u79fb\uff08\u5b9e\u6d4b\u4e00\u6b21\u8de8 15 \u4e2a\u7248\u672c\u7684\u8fc1\u79fb\uff0c<strong>7 \u5f20\u4e3b\u8868\u8ba1\u6570\u96f6\u4e22\u5931<\/strong>\uff09\u3002\u26a0\ufe0f <strong>\u52a8\u624b\u524d\u5148\u5907\u4efd <code>data\/<\/code><\/strong>\u2014\u2014\u8fc1\u79fb\u53ea\u524d\u8fdb\u4e0d\u540e\u9000\uff0c\u56de\u6eda\u7248\u672c\u65f6\u65e7\u5e93\u53ef\u80fd\u6253\u4e0d\u5f00\u3002<\/p>\n<p>\u5f53\u524d\u7248\u672c\u7684\u51e0\u4e2a\u5b57\u6bb5\u8981\u70b9\uff1a<code>individuals<\/code> \u8868\u7684\u6807\u8bc6\u5217\u662f <code>individual_id<\/code>\uff1b\u79c1\u804a\u662f\u5426\u6682\u505c\u56de\u590d\u7531 <code>[chat.reply_timing] private_reply_paused<\/code> \u63a7\u5236\uff0c<strong>\u4e0d\u518d\u6709\u72ec\u7acb\u7684 <code>private_talk_value<\/code> \u5b57\u6bb5<\/strong>\u3002<\/p>\n<p>\u79bb\u7ebf\u67e5\u5e93\/\u8dd1\u811a\u672c\u524d<strong>\u5fc5\u987b\u505c core<\/strong>\uff08A_Memorix \u6709\u72ec\u5360\u5199\u9501 <code>.a_memorix_runtime_writer.lock<\/code>\uff09\uff0c\u4e14 <code>--network<\/code> \u540d\u8981\u5199 <code>maibot_maibot<\/code>\uff0c\u5199\u9519\u76f4\u63a5 <code>rc=125<\/code>\u3002<\/p>\n<p>\u26a0\ufe0f \u5bb9\u5668\u5185<strong>\u6ca1\u6709 <code>sqlite3<\/code> \u547d\u4ee4\u884c<\/strong>\uff0c\u53ea\u80fd\u8d70 Python \u7684 <code>sqlite3<\/code>\uff083.46.1\uff09\u3002\u53e6\u5916 <code>raw.githubusercontent.com<\/code> \u5728 NAS \u4e0d\u53ef\u8fbe\uff08<code>api.github.com<\/code> \u6b63\u5e38\uff09\uff0cheredoc \u4f20 Python \u811a\u672c\u4f1a\u88ab shell \u5403\u6389\u5f15\u53f7\uff0c\u6539\u7528 base64 \u5206\u6bb5\u4f20\u8f93\u3002<\/p>\n<p>\u26a0\ufe0f \u63d2\u4ef6\u4f9d\u8d56\u624b\u52a8\u88c5\u65f6\uff0c<code>\/MaiMBot\/.venv<\/code> <strong>\u4e0d\u5728\u6302\u8f7d\u91cc<\/strong>\uff08\u6302\u8f7d\u53ea\u6709 config \/ data \/ plugins \/ logs \/ depends-data\uff09\u21d2 <strong>\u5bb9\u5668 recreate \u4f1a\u4e22\u6389\u6240\u6709 pip \u88c5\u7684\u5305<\/strong>\uff0c\u5f97\u91cd\u88c5\u3002<\/p>\n<h2>\u4e5d\u3001\u5df2\u77e5\u8fb9\u754c<\/h2>\n<ul>\n<li>\u5b98\u65b9\u9002\u914d\u5668<strong>\u4e0d\u652f\u6301\u6233\u4e00\u6233<\/strong>\uff0c<strong>\u6587\u4ef6\u548c\u5408\u5e76\u8f6c\u53d1\u4e5f\u4e0d\u652f\u6301<\/strong>\uff08<code>[capabilities].files = false<\/code>\uff1b518 \u6761\u7fa4\u6d88\u606f\u91cc\u53ea\u6709 7 \u6761\u5e26 <code>file<\/code> \u6bb5\uff0c\u4e3b\u94fe\u4e0d\u4e0b\u8f7d\u4e5f\u4e0d\u767b\u8bb0\uff09\u3002<\/li>\n<li>\u51fa\u7ad9 @ \u522b\u4eba\u7684\u80fd\u529b<strong>\u67e5\u6e05\u4e86\u4f46\u6ca1\u505a<\/strong>\uff08\u7f3a <code>qq_mention<\/code> \u5de5\u5177\uff09\u3002<\/li>\n<li><code>bot_config.toml<\/code> \u7684 <code>[webui] allowed_ips=127.0.0.1<\/code> <strong>\u5b9e\u9645\u4e0d\u751f\u6548<\/strong>\uff08\u5b9e\u6d4b\u4ece\u53e6\u4e00\u53f0\u5185\u7f51\u673a\u5668\u76f4\u8fde\u4ecd\u8fd4\u56de 200\uff09\u21d2 <strong>\u4e0d\u80fd\u5f53\u8bbf\u95ee\u63a7\u5236\u7528<\/strong>\uff0c\u8981\u9650\u5236\u5c31\u9760\u9632\u706b\u5899\u3002<\/li>\n<li>708 \u6761\u5386\u53f2 QQ \u53f7 ID \u53ea\u80fd\u968f\u65b0\u6d88\u606f\u81ea\u7136\u66ff\u6362\u3002<\/li>\n<\/ul>\n<p>\u66f4\u65b0\u524d\u5148\u5907\u4efd <code>data\/<\/code>\uff1b\u6539\u5b8c\u914d\u7f6e\u6309\u300c\u5148\u770b compose \u72b6\u6001\u548c\u6838\u5fc3\u65e5\u5fd7\uff0c\u518d\u9a8c WebUI\u3001\u6700\u540e\u9a8c\u6d4b\u8bd5\u7fa4\u300d\u7684\u987a\u5e8f\u6392\u67e5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u90e8\u7f72\u9501\u5b9a\u7248\u672c\u7684 MaiBot\uff0c\u4fdd\u7559\u5bb9\u5668\u6570\u636e\uff0c\u5148\u9a8c\u8bc1\u6a21\u578b\u56de\u590d\uff0c\u518d\u7528 QQ \u5b98\u65b9\u673a\u5668\u4eba\u63a5\u5165\u6d4b\u8bd5\u7fa4\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[37,41,42],"class_list":["post-91","post","type-post","status-publish","format-standard","hentry","category-self-hosting","tag-docker","tag-maibot","tag-openai-compatible-api"],"_links":{"self":[{"href":"https:\/\/wp.xybcm.cn\/index.php?rest_route=\/wp\/v2\/posts\/91","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.xybcm.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.xybcm.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.xybcm.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.xybcm.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=91"}],"version-history":[{"count":5,"href":"https:\/\/wp.xybcm.cn\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":159,"href":"https:\/\/wp.xybcm.cn\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions\/159"}],"wp:attachment":[{"href":"https:\/\/wp.xybcm.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.xybcm.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.xybcm.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}