Skip to content

Commit 37f45d4

Browse files
committed
feat:maisaka使用主程序的message格式,优化逻辑,移除冗余模块
1 parent 03ed59e commit 37f45d4

16 files changed

Lines changed: 863 additions & 1291 deletions

prompts/en-US/maidairy_context_summarize.prompt

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

prompts/ja-JP/maidairy_context_summarize.prompt

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

prompts/zh-CN/maidairy_chat.prompt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
你的任务是分析聊天和聊天中的互动情况。
2-
你需要关注 麦麦(AI) 与用户的对话来为选择正确的动作和行为提供建议
2+
你需要关注 {bot_name}(AI) 与不同用户的对话来为选择正确的动作和行为提供建议
33

44
【参考信息】
5-
麦麦的人设:{identity}
5+
{bot_name}的人设:{identity}
66
【参考信息结束】
77

88
你需要根据提供的参考信息,当前场景和输出规则来进行分析
@@ -11,16 +11,17 @@
1111

1212

1313
你可以使用这些工具:
14-
wait(seconds) - 暂时停止对话,等待(seconds)秒,把话语权交给用户,等待对方新的发言。
15-
stop() - 结束对话,不进行任何回复,直到对方有新消息。
16-
- `reply()`:当你判断现在应该正式对用户发出一条可见回复时调用。调用后系统会基于你当前这轮的想法生成一条真正展示给用户的回复。
17-
- `no_reply()`:当你判断现在不应该发言,应该继续内部思考时调用。这个工具不会做任何外部行为,只会继续下一轮循环。
14+
- wait(seconds) - 暂时停止对话,等待(seconds)秒,把话语权交给用户,等待对方新的发言。
15+
- stop() - 结束对话,不进行任何回复,直到对方有新消息。
16+
- reply():当你判断现在应该正式对用户发出一条可见回复时调用。调用后系统会基于你当前这轮的想法生成一条真正展示给用户的回复。
17+
- no_reply():当你判断现在不应该发言,应该继续内部思考时调用。这个工具不会做任何外部行为,只会继续下一轮循环。
1818
{file_tools_section}
1919

2020
工具使用规则:
2121
1.如果麦麦已经回复,但用户暂时没有新的回复,且没有新信息需要搜集,使用wait或者stop进行等待
2222
2.如果用户有新发言,但是你评估用户还有后续发言尚未发送,可以适当等待让用户说完
23-
3.如果你想指导麦麦直接发言,可以不使用任何工具
23+
3.在特定情况下也可以连续回复,例如想要追问,或者补充自己先前的发言,可以不使用stop或者wait
24+
4.如果你想指导麦麦直接发言,可以不使用任何工具
2425

2526
你的输出规则:
2627
1. 默认直接输出你当前的最新分析,不要重复之前的分析内容。

prompts/zh-CN/maidairy_context_summarize.prompt

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

src/config/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
BOT_CONFIG_PATH: Path = (CONFIG_DIR / "bot_config.toml").resolve().absolute()
5656
MODEL_CONFIG_PATH: Path = (CONFIG_DIR / "model_config.toml").resolve().absolute()
5757
MMC_VERSION: str = "1.0.0"
58-
CONFIG_VERSION: str = "8.1.2"
58+
CONFIG_VERSION: str = "8.1.4"
5959
MODEL_CONFIG_VERSION: str = "1.12.0"
6060

6161
logger = get_logger("config")

src/config/official_configs.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,6 +1600,24 @@ class MaiSakaConfig(ConfigBase):
16001600
)
16011601
"""是否在 CLI 中显示 analyze_timing 的 Prompt"""
16021602

1603+
show_thinking: bool = Field(
1604+
default=True,
1605+
json_schema_extra={
1606+
"x-widget": "switch",
1607+
"x-icon": "brain",
1608+
},
1609+
)
1610+
"""鏄惁鍦?CLI 涓樉绀哄唴蹇冩€濊€冨拰瀹屾暣 Prompt"""
1611+
1612+
user_name: str = Field(
1613+
default="用户",
1614+
json_schema_extra={
1615+
"x-widget": "input",
1616+
"x-icon": "user",
1617+
},
1618+
)
1619+
"""MaiSaka 涓敤鎴风殑鏄剧ず鍚嶇О"""
1620+
16031621
class PluginRuntimeConfig(ConfigBase):
16041622
"""插件运行时配置类"""
16051623

src/maisaka/builtin_tools.py

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
MaiSaka built-in tool definitions.
33
"""
44

5-
from typing import Any, Dict, List
5+
from typing import List
66

77
from src.llm_models.payload_content.tool_option import ToolOption, ToolParamType
88

@@ -43,44 +43,6 @@ def create_builtin_tools() -> List[ToolOption]:
4343
return tools
4444

4545

46-
def builtin_tools_as_dicts() -> List[Dict[str, Any]]:
47-
"""Return built-in tools as plain dictionaries."""
48-
return [
49-
{
50-
"name": "wait",
51-
"description": "Pause speaking and wait for the user to provide more input.",
52-
"parameters": {
53-
"type": "object",
54-
"properties": {
55-
"seconds": {
56-
"type": "number",
57-
"description": "How many seconds to wait before timing out.",
58-
}
59-
},
60-
"required": ["seconds"],
61-
},
62-
},
63-
{
64-
"name": "reply",
65-
"description": "Generate and emit a visible reply based on the current thought.",
66-
"parameters": {"type": "object", "properties": {}, "required": []},
67-
},
68-
{
69-
"name": "no_reply",
70-
"description": "Do not emit a visible reply this round and continue thinking.",
71-
"parameters": {"type": "object", "properties": {}, "required": []},
72-
},
73-
{
74-
"name": "stop",
75-
"description": "Stop the current inner loop and return control to the outer chat flow.",
76-
"parameters": {"type": "object", "properties": {}, "required": []},
77-
},
78-
]
79-
80-
8146
def get_builtin_tools() -> List[ToolOption]:
8247
"""Return built-in tools."""
8348
return create_builtin_tools()
84-
85-
86-
BUILTIN_TOOLS_DICTS = builtin_tools_as_dicts()

0 commit comments

Comments
 (0)