mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
新增插件智能模式适配
This commit is contained in:
parent
aef2597b46
commit
29305bda5b
@ -213,6 +213,22 @@ class Task(BaseBlock):
|
||||
check_args: list = Field(default_factory=list)
|
||||
"""检查函数参数"""
|
||||
|
||||
class AbstractTool(BaseModel):
|
||||
name: str | None = None
|
||||
"""工具名称"""
|
||||
parameters: dict[str, Any] | None = None
|
||||
"""工具参数"""
|
||||
description: str | None = None
|
||||
"""工具描述"""
|
||||
func: Callable | None = None
|
||||
"""工具函数"""
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
'name': self.name,
|
||||
'description': self.description,
|
||||
'parameters': self.parameters
|
||||
}
|
||||
|
||||
class PluginExtraData(BaseModel):
|
||||
"""
|
||||
@ -249,6 +265,8 @@ class PluginExtraData(BaseModel):
|
||||
"""常用sql"""
|
||||
is_show: bool = True
|
||||
"""是否显示在菜单中"""
|
||||
smart_tools: list[AbstractTool] | None = None
|
||||
"""智能模式函数工具集"""
|
||||
|
||||
def to_dict(self, **kwargs):
|
||||
return model_dump(self, **kwargs)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user