-
-
Notifications
You must be signed in to change notification settings - Fork 963
Open
Labels
bugSomething isn't workingSomething isn't working
Description
发生了什么
以类的形式加函数工具,重载插件不会卸载函数工具导致重复创建。
也许AstrBot本体可以修复,或者在文档中提及由插件本身处理。
如何复现?
按文档
class MyPlugin(Star):
def __init__(self, context: Context):
super().__init__(context)
# >= v4.5.1 使用:
self.context.add_llm_tools(HelloWorldTool(), SecondTool(), ...)部分原因是add_llm_tools直接append导致所述问题
def add_llm_tools(self, *tools: FunctionTool) -> None:
"""添加 LLM 工具。"""
for tool in tools:
self.provider_manager.llm_tools.func_list.append(tool)AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器
AstrBot v4.5.0
操作系统
Linux
报错日志
你愿意提交 PR 吗?
- 是的,我愿意提交 PR!
Code of Conduct
- 我已阅读并同意遵守该项目的 行为准则。
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working