feat: add Tool component

This commit is contained in:
Junyan Qin
2025-07-06 21:03:33 +08:00
parent a60aa6f644
commit 5b044a1917
11 changed files with 84 additions and 66 deletions

View File

@@ -5,7 +5,6 @@ import typing
from ...core import app
import langbot_plugin.api.entities.builtin.resource.tool as resource_tool
import langbot_plugin.api.entities.builtin.pipeline.query as pipeline_query
preregistered_loaders: list[typing.Type[ToolLoader]] = []
@@ -36,7 +35,7 @@ class ToolLoader(abc.ABC):
pass
@abc.abstractmethod
async def get_tools(self, enabled: bool = True) -> list[resource_tool.LLMTool]:
async def get_tools(self) -> list[resource_tool.LLMTool]:
"""获取所有工具"""
pass
@@ -46,7 +45,7 @@ class ToolLoader(abc.ABC):
pass
@abc.abstractmethod
async def invoke_tool(self, query: pipeline_query.Query, name: str, parameters: dict) -> typing.Any:
async def invoke_tool(self, name: str, parameters: dict) -> typing.Any:
"""执行工具调用"""
pass