mirror of
https://github.com/ddaodan/minechatgpt.git
synced 2026-06-21 21:45:28 +08:00
feat: 新增请求协调与统计能力,并实现配置/语言文件安全自动补全
- 新增 RequestCoordinator,请求统一走限流、冷却、排队与派发流程 - 新增 token 估算与 UsageTracker,并接入 API usage 解析(prompt/completion/total) - 新增上下文 token 预算裁剪与可选自动总结能力 - 重构命令调用链至协调器,新增 `/chatgpt stats [reset]`,同步补全权限与补全提示 - 新增 ConfigFileUpdater:为 `config.yml` 与 `lang/*.yml` 自动补齐缺失项,保留用户已有配置与注释,并生成备份 - 修复自动补全插入顺序/空行/注释归属问题,避免重复块与空行膨胀 - 优化 `config.yml` 注释说明:保持原意,仅补充更清晰的中英文细节说明
This commit is contained in:
@@ -11,17 +11,28 @@ messages:
|
||||
help_context: "&e/chatgpt context - Toggle context mode."
|
||||
help_clear: "&e/chatgpt clear - Clear conversation history."
|
||||
help_character: "&e/chatgpt character [character_name] - List or switch to a character."
|
||||
help_stats: "&e/chatgpt stats - Show token usage statistics."
|
||||
context_toggle: "&eContext is now %s."
|
||||
context_toggle_enabled: "&aenabled"
|
||||
context_toggle_disabled: "&cdisabled"
|
||||
current_model_info: "&eCurrent model: %s. Use /chatgpt model <model_name> to switch models."
|
||||
model_switch: "&aModel switched to %s"
|
||||
chatgpt_error: "&cFailed to contact ChatGPT."
|
||||
no_api_key: "&cNo API key configured. Please set api.keys in config.yml."
|
||||
chatgpt_response: "&b%s: %s"
|
||||
question: "&bYou: %s"
|
||||
queued: "&eYour request has been queued. Position: %s"
|
||||
queue_full: "&cQueue is full. Please try again later."
|
||||
queue_full_user: "&cYou have too many pending requests. Please wait."
|
||||
cooldown: "&cYou're sending requests too fast. Please wait %s ms."
|
||||
rate_limited: "&cRate limited. Please try again later."
|
||||
stats_header: "&e===== MineChatGPT Stats ====="
|
||||
stats_global: "&eGlobal tokens: %s (prompt=%s, completion=%s), requests=%s"
|
||||
stats_user: "&eYour tokens: %s (prompt=%s, completion=%s), requests=%s"
|
||||
stats_reset: "&aStats reset."
|
||||
character_switched: "&aSwitched to character: %s"
|
||||
available_characters: "&eAvailable characters:"
|
||||
invalid_character: "&cInvalid character. Use /chatgpt character to list available characters."
|
||||
invalid_model: "&cInvalid model. Use /chatgpt modellist to see available models."
|
||||
available_models: "&eAvailable models:"
|
||||
no_permission: "&cYou do not have permission to use this command. Required permission: %s"
|
||||
no_permission: "&cYou do not have permission to use this command. Required permission: %s"
|
||||
|
||||
@@ -11,17 +11,28 @@ messages:
|
||||
help_context: "&e/chatgpt context - 切换连续对话模式"
|
||||
help_clear: "&e/chatgpt clear - 清空对话历史"
|
||||
help_character: "&e/chatgpt character [character_name] - 列出或切换角色"
|
||||
help_stats: "&e/chatgpt stats - 查看 token 消耗统计"
|
||||
context_toggle: "&e连续对话模式已%s。"
|
||||
context_toggle_enabled: "&a开启"
|
||||
context_toggle_disabled: "&c关闭"
|
||||
current_model_info: "&e当前模型:%s,输入 /chatgpt model <model_name> 来切换模型。"
|
||||
model_switch: "&a已切换至模型 %s"
|
||||
chatgpt_error: "&c无法联系ChatGPT。"
|
||||
no_api_key: "&c未配置 API Key,请在 config.yml 的 api.keys 中设置。"
|
||||
chatgpt_response: "&b%s: %s"
|
||||
question: "&b你: %s"
|
||||
queued: "&e你的请求已进入队列,当前位置:%s"
|
||||
queue_full: "&c队列已满,请稍后再试。"
|
||||
queue_full_user: "&c你有太多等待中的请求,请先等待。"
|
||||
cooldown: "&c请求过快,请等待 %s 毫秒。"
|
||||
rate_limited: "&c触发限流,请稍后再试。"
|
||||
stats_header: "&e===== MineChatGPT 统计 ====="
|
||||
stats_global: "&e全局 tokens:%s(prompt=%s,completion=%s),请求数=%s"
|
||||
stats_user: "&e你的 tokens:%s(prompt=%s,completion=%s),请求数=%s"
|
||||
stats_reset: "&a统计已重置。"
|
||||
character_switched: "&a已切换至角色: %s"
|
||||
available_characters: "&e可用的角色列表:"
|
||||
invalid_character: "&c无效的角色。使用 /chatgpt character 查看所有可用的角色。"
|
||||
invalid_model: "&c模型无效。使用 /chatgpt modellist 查看可用模型。"
|
||||
available_models: "&e可用模型列表:"
|
||||
no_permission: "&c你没有权限使用这个指令。需要的权限:%s"
|
||||
no_permission: "&c你没有权限使用这个指令。需要的权限:%s"
|
||||
|
||||
Reference in New Issue
Block a user