feat:修复门控多重result问题,新增at动作,插件现在运行chat_id指定或chat_type指定
This commit is contained in:
@@ -4,7 +4,14 @@ from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from src.core.tooling import ToolExecutionContext, ToolExecutionResult, ToolInvocation, ToolProvider, ToolSpec
|
||||
from src.core.tooling import (
|
||||
ToolAvailabilityContext,
|
||||
ToolExecutionContext,
|
||||
ToolExecutionResult,
|
||||
ToolInvocation,
|
||||
ToolProvider,
|
||||
ToolSpec,
|
||||
)
|
||||
|
||||
from .manager import MCPManager
|
||||
|
||||
@@ -24,9 +31,13 @@ class MCPToolProvider(ToolProvider):
|
||||
|
||||
self._manager = manager
|
||||
|
||||
async def list_tools(self) -> list[ToolSpec]:
|
||||
async def list_tools(
|
||||
self,
|
||||
context: Optional[ToolAvailabilityContext] = None,
|
||||
) -> list[ToolSpec]:
|
||||
"""列出全部 MCP 工具。"""
|
||||
|
||||
del context
|
||||
return self._manager.get_tool_specs()
|
||||
|
||||
async def invoke(
|
||||
|
||||
Reference in New Issue
Block a user