-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
插件市场支持拼音搜索 #2935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
插件市场支持拼音搜索 #2935
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `packages/astrbot/main.py:96-101` </location>
<code_context>
"""停用所有函数工具"""
await self.tool_c.tool_all_off(event)
+ @tool.command("on_all")
+ async def tool_all_on(self, event: AstrMessageEvent):
+ """启用所有函数工具"""
+ tm = self.context.get_llm_tool_manager()
+ for tool in tm.func_list:
+ self.context.activate_llm_tool(tool.name)
+ event.set_result(MessageEventResult().message("启用所有工具成功。"))
+
@filter.command_group("plugin")
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Handle activation errors for individual tools.
Currently, activation errors for individual tools are not handled, which may mislead users if some tools fail to activate. Please add error handling and reporting for each tool activation.
```suggestion
async def tool_all_on(self, event: AstrMessageEvent):
"""启用所有函数工具"""
tm = self.context.get_llm_tool_manager()
failed_tools = []
for tool in tm.func_list:
try:
self.context.activate_llm_tool(tool.name)
except Exception as e:
failed_tools.append(tool.name)
if not failed_tools:
msg = "启用所有工具成功。"
else:
msg = f"部分工具启用失败:{', '.join(failed_tools)}。其他工具已成功启用。"
event.set_result(MessageEventResult().message(msg))
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| async def tool_all_on(self, event: AstrMessageEvent): | ||
| """启用所有函数工具""" | ||
| tm = self.context.get_llm_tool_manager() | ||
| for tool in tm.func_list: | ||
| self.context.activate_llm_tool(tool.name) | ||
| event.set_result(MessageEventResult().message("启用所有工具成功。")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): Handle activation errors for individual tools.
Currently, activation errors for individual tools are not handled, which may mislead users if some tools fail to activate. Please add error handling and reporting for each tool activation.
| async def tool_all_on(self, event: AstrMessageEvent): | |
| """启用所有函数工具""" | |
| tm = self.context.get_llm_tool_manager() | |
| for tool in tm.func_list: | |
| self.context.activate_llm_tool(tool.name) | |
| event.set_result(MessageEventResult().message("启用所有工具成功。")) | |
| async def tool_all_on(self, event: AstrMessageEvent): | |
| """启用所有函数工具""" | |
| tm = self.context.get_llm_tool_manager() | |
| failed_tools = [] | |
| for tool in tm.func_list: | |
| try: | |
| self.context.activate_llm_tool(tool.name) | |
| except Exception as e: | |
| failed_tools.append(tool.name) | |
| if not failed_tools: | |
| msg = "启用所有工具成功。" | |
| else: | |
| msg = f"部分工具启用失败:{', '.join(failed_tools)}。其他工具已成功启用。" | |
| event.set_result(MessageEventResult().message(msg)) |
fixes #XYZ
Motivation / 动机
Modifications / 改动点
dashboard/src/views/ExtensionPage.vue:pinyin-pronormalizeStr、toPinyinText、toInitialsmarketCustomFilter,对名称/简称/描述/作者进行拼音与首字母匹配v-data-table绑定:custom-filter="marketCustomFilter"dashboard/package.json:"pinyin-pro": "^3.26.0"Verification Steps / 验证步骤
dashboard执行:npm inpm run devScreenshots or Test Results / 运行截图或测试结果
Compatibility & Breaking Changes / 兼容性与破坏性变更
Checklist / 检查清单
requirements.txt和pyproject.toml文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations inrequirements.txtandpyproject.toml.Sourcery 总结
在插件市场中启用拼音和首字母搜索,并引入一个新的机器人命令来激活所有功能工具。
新功能:
改进:
Original summary in English
Summary by Sourcery
Enable pinyin and initials search in the plugin marketplace and introduce a new bot command to activate all function tools.
New Features:
Enhancements: