Skip to content

Commit 8ca150b

Browse files
authored
Merge pull request #1325 from MaiM-with-u/dev
Dev
2 parents f6e33d8 + 4d5456e commit 8ca150b

File tree

125 files changed

+9036
-12629
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+9036
-12629
lines changed

.envrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
*.bat text eol=crlf
2-
*.cmd text eol=crlf
3-
MaiLauncher.bat text eol=crlf working-tree-encoding=GBK
2+
*.cmd text eol=crlf

.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ MaiBot-Napcat-Adapter
2020
nonebot-maibot-adapter/
2121
MaiMBot-LPMM
2222
*.zip
23+
run_bot.bat
24+
run_na.bat
2325
run.bat
2426
log_debug/
2527
run_amds.bat
@@ -41,16 +43,13 @@ config/bot_config.toml
4143
config/bot_config.toml.bak
4244
config/lpmm_config.toml
4345
config/lpmm_config.toml.bak
44-
src/mais4u/config/s4u_config.toml
45-
src/mais4u/config/old
4646
template/compare/bot_config_template.toml
4747
template/compare/model_config_template.toml
4848
(测试版)麦麦生成人格.bat
4949
(临时版)麦麦开始学习.bat
5050
src/plugins/utils/statistic.py
5151
CLAUDE.md
52-
s4u.s4u
53-
s4u.s4u1
52+
5453
# Byte-compiled / optimized / DLL files
5554
__pycache__/
5655
*.py[cod]
@@ -321,9 +320,14 @@ run_pet.bat
321320
/plugins/*
322321
!/plugins
323322
!/plugins/hello_world_plugin
323+
!/plugins/emoji_manage_plugin
324324
!/plugins/take_picture_plugin
325+
!/plugins/deep_think
326+
!/plugins/ChatFrequency/
327+
!/plugins/__init__.py
325328

326329
config.toml
327330

328331
interested_rates.txt
329332
MaiBot.code-workspace
333+
*.lock

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
## 🔥 更新和安装
4646

47-
**最新版本: v0.10.3** ([更新日志](changelogs/changelog.md))
47+
**最新版本: v0.11.0** ([更新日志](changelogs/changelog.md))
4848

4949
可前往 [Release](https://github.com/MaiM-with-u/MaiBot/releases/) 页面下载最新版本
5050
可前往 [启动器发布页面](https://github.com/MaiM-with-u/mailauncher/releases/)下载最新启动器

bot.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,29 @@
55
import time
66
import platform
77
import traceback
8+
import shutil
89
from dotenv import load_dotenv
910
from pathlib import Path
1011
from rich.traceback import install
1112

12-
if os.path.exists(".env"):
13-
load_dotenv(".env", override=True)
13+
env_path = Path(__file__).parent / ".env"
14+
template_env_path = Path(__file__).parent / "template" / "template.env"
15+
16+
if env_path.exists():
17+
load_dotenv(str(env_path), override=True)
1418
print("成功加载环境变量配置")
1519
else:
16-
print("未找到.env文件,请确保程序所需的环境变量被正确设置")
17-
raise FileNotFoundError(".env 文件不存在,请创建并配置所需的环境变量")
20+
try:
21+
if template_env_path.exists():
22+
shutil.copyfile(template_env_path, env_path)
23+
print("未找到.env,已从 template/template.env 自动创建")
24+
load_dotenv(str(env_path), override=True)
25+
else:
26+
print("未找到.env文件,也未找到模板 template/template.env")
27+
raise FileNotFoundError(".env 文件不存在,请创建并配置所需的环境变量")
28+
except Exception as e:
29+
print(f"自动创建 .env 失败: {e}")
30+
raise
1831

1932
# 最早期初始化日志系统,确保所有后续模块都使用正确的日志格式
2033
from src.common.logger import initialize_logging, get_logger, shutdown_logging

changelogs/changelog.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
11
# Changelog
22

3-
0.10.4饼 表达方式优化
4-
无了
3+
## [0.11.0] - 2025-9-22
4+
### 🌟 主要功能更改
5+
- 重构记忆系统,新的记忆系统更可靠,双通道查询,可以查询文本记忆和过去聊天记录
6+
- 主动发言功能,麦麦会自主提出问题(可精细调控频率)
7+
- 支持多重人格设定,可以随机切换成不同状态
8+
- 新增表达方式学习新模式,更少的占用
9+
- 添加表情包管理插件
10+
- 现可更好的支持多平台
11+
- 添加deepthink插件(默认关闭),让麦麦可以深度思考一些问题
12+
- 现已内置BetterFrequency插件
13+
14+
15+
### 细节功能更改
16+
- 修复配置文件转义问题
17+
- 情绪系统现在可以由配置文件控制开关
18+
- 修复平行动作控制失效的问题
19+
- 添加planner防抖,防止短时间快速消耗token
20+
- 优化planner历史状态记录
21+
- 修复吞字问题
22+
- 修复意外换行问题
23+
- 移除VLM的token限制
24+
- 为tool工具添加chat_id字段
25+
- 更新依赖表
26+
- 修复负载均衡
27+
- 现统计模型名而不是模型标识符
28+
- 修改默认推荐模型为ds v3.2
29+
- 优化了对gemini和不同模型的支持,优化了对gemini搜索的支持
530

631
## [0.10.3] - 2025-9-22
732
### 🌟 主要功能更改

changelogs/changelog_config.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

docs/model_configuration_guide.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ version = "1.1.1"
2828
```toml
2929
[[api_providers]]
3030
name = "DeepSeek" # 服务商名称(自定义)
31-
base_url = "https://api.deepseek.cn/v1" # API服务的基础URL
31+
base_url = "https://api.deepseek.com/v1" # API服务的基础URL
3232
api_key = "your-api-key-here" # API密钥
3333
client_type = "openai" # 客户端类型
3434
max_retry = 2 # 最大重试次数
@@ -43,19 +43,19 @@ retry_interval = 10 # 重试间隔(秒)
4343
| `name` || 服务商名称,需要在模型配置中引用 | - |
4444
| `base_url` || API服务的基础URL | - |
4545
| `api_key` || API密钥,请替换为实际密钥 | - |
46-
| `client_type` || 客户端类型:`openai`(OpenAI格式)或 `gemini`(Gemini格式,现在支持不良好| `openai` |
46+
| `client_type` || 客户端类型:`openai`(OpenAI格式)或 `gemini`(Gemini格式) | `openai` |
4747
| `max_retry` || API调用失败时的最大重试次数 | 2 |
4848
| `timeout` || API请求超时时间(秒) | 30 |
4949
| `retry_interval` || 重试间隔时间(秒) | 10 |
5050

51-
**请注意,对于`client_type``gemini`的模型,`base_url`字段无效**
51+
**请注意,对于`client_type``gemini`的模型,`retry`字段由`gemini`自己决定**
5252
### 2.3 支持的服务商示例
5353

5454
#### DeepSeek
5555
```toml
5656
[[api_providers]]
5757
name = "DeepSeek"
58-
base_url = "https://api.deepseek.cn/v1"
58+
base_url = "https://api.deepseek.com/v1"
5959
api_key = "your-deepseek-api-key"
6060
client_type = "openai"
6161
```
@@ -73,7 +73,7 @@ client_type = "openai"
7373
```toml
7474
[[api_providers]]
7575
name = "Google"
76-
base_url = "https://api.google.com/v1"
76+
base_url = "https://generativelanguage.googleapis.com/v1beta"
7777
api_key = "your-google-api-key"
7878
client_type = "gemini" # 注意:Gemini需要使用特殊客户端
7979
```
@@ -131,9 +131,20 @@ enable_thinking = false # 禁用思考
131131
[models.extra_params]
132132
thinking = {type = "disabled"} # 禁用思考
133133
```
134+
135+
而对于`gemini`需要单独进行配置
136+
```toml
137+
[[models]]
138+
model_identifier = "gemini-2.5-flash"
139+
name = "gemini-2.5-flash"
140+
api_provider = "Google"
141+
[models.extra_params]
142+
thinking_budget = 0 # 禁用思考
143+
# thinking_budget = -1 由模型自己决定
144+
```
145+
134146
请注意,`extra_params` 的配置应该构成一个合法的TOML字典结构,具体内容取决于API服务商的要求。
135147

136-
**请注意,对于`client_type``gemini`的模型,此字段无效。**
137148
### 3.3 配置参数说明
138149

139150
| 参数 | 必填 | 说明 |

flake.lock

Lines changed: 0 additions & 57 deletions
This file was deleted.

flake.nix

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)