GamesAI

This plugin allows you to use AI in the game

tool

Installation command

!!MCDR plugin install games_ai

Author

Synced at

...

Last update

...

Latest version

Total downloads

1369

Back to catalogue

GamesAI-v0.7.3.mcdr

Version

0.7.3

Date

October 2, 2026

Size

271.50 KiB

Downloads

18

MD5

22f4af0cd6f746f066e64b0d4524732d

SHA256

9f2252eca06317f830c801e80a0d971ba099850c8411d903785be02097999811

MCDR Plugin Dependencies

Plugin IDRequirement
mcdreforged>=2.15.0

Python Package Requirements

Python PackageRequirement
openai
requests
websockets

Python Package Installation Command

pip install openai requests websockets

GamesAI 0.7.3

本次更新重做了请求里的消息结构:不再出现第二条 system 消息,时间改由提问前的 user 消息承载,长会话的前缀缓存也能持续命中。

🧱 消息结构重做

  • system 只剩一条 — prompt 与技能列表合并为一条 system 消息,当前时间从中移出。部分上游(Qwen3.5/3.6/3.8 的 chat template 等)只允许下标 0 是 system,此前会直接返回 System message must be at the beginning,这些模型完全不可用。
  • 公共数据改用 assistant — 它是资料而不是命令;公共数据库为空时这条消息完全不发送,不会再出现一条空的"公共数据列表:"。
  • 当前时间改为 user 消息,写在提问正前方 — 第 1 轮注入,之后每 20 轮再注入一次。它写入历史,因此相邻两轮之间的提示词前缀完全一致,服务商的前缀缓存可以持续命中(此前时间在 system 首行、每轮都变,等于每轮把整段历史重新计费一次)。
  • 技能提示改用 user — !!ask /技能.md 注入的"先读这个技能"提示不再是一条 system。
  • 连续的 user 消息在发出前合并成一条 — 时间 + 提问、技能提示 + 提问、!!ask -f 的多条补充、上一轮失败后的重问都会合并:部分上游要求 user/assistant 严格交替,模型也不会再把它们当成两轮、只答最后一条。历史里仍分别保存。
  • 轮次切分同步修正 — 连续 user 视为同一回合,注入的时间不会被算成独立一轮(KEEP_ROUNDS = 10 与压缩边界保持正确)。

🔧 修复

  • 清理残留 Node 进程的两处调用 — run_node()(启动前清理)与"检测到不支持的服务器版本 → 重装依赖并重启假人"路径上的 _kill_mineflayer_process() 都补上了缺失的进程参数;此前会抛 TypeError 并被 try/except 吞掉,只留下一条日志。
  • 调试日志字段更名 — !!gamesai debug 的请求头部由 system= 改为 preamble=(该位置现在也可能包含一条 assistant 消息)。

📚 文档

  • 三语技术文档新增「请求里的消息结构」一节,并同步更新请求链路、!!ask -n 一致性条目与"每玩家状态"里的 system_message 说明。

⚠️ 已知问题

  • 历史压缩摘要与切模型转接摘要仍以 system 消息注入(本次未改动),因此在只允许一条 system 的上游上,这两条路径仍可能被拒绝。

升级提示

  • 配置无需改动;!!ask -n 与常规路径的消息结构保持一致。
  • 升级后第一次请求会重建提示词前缀,旧的前缀缓存会失效一次,之后恢复正常。

完整说明见 docs/zh_cn/changelog.md。


GamesAI 0.7.3

This release reworks the message layout of a request: a second system message is gone, the current time travels as a user message in front of the question, and the provider's prefix cache keeps hitting in long conversations.

🧱 The message layout

  • A single system message — the model's prompt and the skills list are merged into one system message, with the current time moved out of it. Some upstreams (the Qwen3.5/3.6/3.8 chat template, for one) accept a system message at index 0 only and answered System message must be at the beginning, which made those models unusable.
  • The public data travels as an assistant message — reference material rather than an instruction; when the database is empty the message is not sent at all, so the empty "public data" line is gone.
  • The current time travels as a user message right in front of the question — injected on the first round, then once every 20 rounds. It is stored in the history, so two consecutive rounds share exactly the same prefix and the provider's prefix cache keeps hitting (before, the time sat in the first line of the system block and changed every round, re-billing the whole history every round).
  • The skill note changed role — the "read this skill first" note injected by !!ask /skill.md is a user message now, not a system one.
  • Adjacent user messages are merged into one before sending — time + question, the skill note + question, several !!ask -f messages, a question retried after a failed round. Some upstreams require strict user/assistant alternation, and a model reading two user turns in a row tends to answer only the last one. The history keeps them apart.
  • Round splitting fixed along with it — consecutive user messages count as one round, so an injected time never becomes a round of its own (KEEP_ROUNDS = 10 and the compression boundaries stay correct).

🔧 Fixes

  • Both _kill_mineflayer_process() call sites — the one in run_node() (cleanup before starting) and the one on the "unsupported server version → reinstall dependencies and restart the bot" path now pass the process argument; they used to raise TypeError, which the surrounding try/except swallowed into a single log line.
  • Debug log field renamed — the request header printed by !!gamesai debug is preamble= now instead of system= (that position can also hold an assistant message).

📚 Documentation

  • A new "What a request contains" section in all three languages, plus matching updates to the request chain, the !!ask -n consistency list and the system_message entry under per-user state.

⚠️ Known issues

  • Context-compression summaries and model-switch hand-off summaries are still injected as system messages (unchanged in this release), so on upstreams that accept a single system message those two paths can still be rejected.

Upgrade notes

  • No configuration change is required; the stateless path (!!ask -n) uses the same layout as the normal one.
  • The first request after the upgrade rebuilds the prompt prefix, so the old prefix cache misses once and then works normally.

Full details: docs/en_us/changelog.md.


GamesAI 0.7.3

本次更新重做了請求裡的訊息結構:不再出現第二條 system 訊息,時間改由提問前的 user 訊息承載,長對話的前綴快取也能持續命中。

🧱 訊息結構重做

  • system 只剩一條 —— prompt 與技能列表合併為一條 system 訊息,目前時間從中移出。部分上游(Qwen3.5/3.6/3.8 的 chat template 等)只允許下標 0 是 system,此前會直接回傳 System message must be at the beginning,這些模型完全不可用。
  • 公共資料改用 assistant —— 它是資料而不是命令;公共資料庫為空時這條訊息完全不發送,不會再出現一條空的「公共資料列表:」。
  • 目前時間改為 user 訊息,寫在提問正前方 —— 第 1 輪注入,之後每 20 輪再注入一次。它會寫入歷史,因此相鄰兩輪之間的提示詞前綴完全一致,服務商的前綴快取可以持續命中(此前時間在 system 首行、每輪都變,等於每輪把整段歷史重新計費一次)。
  • 技能提示改用 user —— !!ask /技能.md 注入的「先讀這個技能」提示不再是一條 system。
  • 連續的 user 訊息在送出前合併成一條 —— 時間 + 提問、技能提示 + 提問、!!ask -f 的多條補充、上一輪失敗後的重問都會合併:部分上游要求 user/assistant 嚴格交替,模型也不會再把它們當成兩輪、只答最後一條。歷史裡仍分別保存。
  • 輪次切分同步修正 —— 連續 user 視為同一回合,注入的時間不會被算成獨立一輪(KEEP_ROUNDS = 10 與壓縮邊界保持正確)。

🔧 修復

  • 清理殘留 Node 行程的兩處呼叫 —— run_node()(啟動前清理)與「偵測到不支援的伺服器版本 → 重裝依賴並重啟假人」路徑上的 _kill_mineflayer_process() 都補上了缺失的行程參數;此前會拋 TypeError 並被 try/except 吞掉,只留下一條日誌。
  • 除錯日誌欄位更名 —— !!gamesai debug 的請求頭部由 system= 改為 preamble=(該位置現在也可能包含一條 assistant 訊息)。

📚 文件

  • 三語技術文件新增「請求裡的訊息結構」一節,並同步更新請求鏈路、!!ask -n 一致性條目與「每玩家狀態」裡的 system_message 說明。

⚠️ 已知問題

  • 歷史壓縮摘要與切換模型轉接摘要仍以 system 訊息注入(本次未改動),因此在只允許一條 system 的上游上,這兩條路徑仍可能被拒絕。

升級提示

  • 設定無需改動;!!ask -n 與一般路徑的訊息結構保持一致。
  • 升級後第一次請求會重建提示詞前綴,舊的前綴快取會失效一次,之後恢復正常。

完整說明見 docs/zh_tw/changelog.md。