refactor(provider): formalize tool lookup contract

This commit is contained in:
huanghuoguoguo
2026-06-06 15:02:47 +08:00
parent cb33bf3260
commit edadff8971
6 changed files with 78 additions and 17 deletions
@@ -3,6 +3,7 @@ from __future__ import annotations
import typing
import traceback
from langbot_plugin.api.definition.components.manifest import ComponentManifest
from langbot_plugin.api.entities.events import pipeline_query
from .. import loader
@@ -39,7 +40,7 @@ class PluginToolLoader(loader.ToolLoader):
return True
return False
async def _get_tool(self, name: str) -> resource_tool.LLMTool:
async def get_tool(self, name: str) -> ComponentManifest | None:
for tool in await self.ap.plugin_connector.list_tools():
if tool.metadata.name == name:
return tool