* stage * refactor: 重构 Function Tool 管理并引入 multi agent handsoff 机制 - Updated `star_request.py` to use the global `call_handler` instead of context-specific calls. - Modified `entities.py` to remove the dependency on `FunctionToolManager` and streamline the function tool handling. - Refactored `func_tool_manager.py` to simplify the `FunctionTool` class and its methods, removing deprecated code and enhancing clarity. - Adjusted `provider.py` to align with the new function tool structure, removing unnecessary type unions. - Enhanced `star_handler.py` to support agent registration and tool association, introducing `RegisteringAgent` for better encapsulation. - Updated `star_manager.py` to handle tool registration for agents, ensuring proper binding of handlers. - Revised `main.py` in the web searcher package to utilize the new agent registration system for web search tools. * chore: websearch * perf: 减少嵌套 * chore: 移除未使用的 mcp 导入
12 lines
384 B
Python
12 lines
384 B
Python
import mcp
|
|
from typing import Any, Generic, AsyncGenerator
|
|
from .run_context import TContext, ContextWrapper
|
|
from .tool import FunctionTool
|
|
|
|
|
|
class BaseFunctionToolExecutor(Generic[TContext]):
|
|
@classmethod
|
|
async def execute(
|
|
cls, tool: FunctionTool, run_context: ContextWrapper[TContext], **tool_args
|
|
) -> AsyncGenerator[Any | mcp.types.CallToolResult, None]: ...
|